Skip to content

changed PY36 constant naming to be more explicit for versions >=3.6 #1509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions plotly/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
### incase people are using threading, we lock file reads
lock = threading.Lock()

PY36 = (
PY36_OR_LATER = (
sys.version_info.major == 3 and sys.version_info.minor >= 6
)

Expand Down Expand Up @@ -289,9 +289,9 @@ def encode_as_numpy(obj):
@staticmethod
def encode_as_datetime(obj):
"""Attempt to convert to utc-iso time string using datetime methods."""
# In PY36, isoformat() converts UTC
# Since PY36, isoformat() converts UTC
# datetime.datetime objs to UTC T04:00:00
if not (PY36 and (isinstance(obj, datetime.datetime) and
if not (PY36_OR_LATER and (isinstance(obj, datetime.datetime) and
obj.tzinfo is None)):
try:
obj = obj.astimezone(pytz.utc)
Expand Down