Skip to content
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