We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 133df4d commit 706f5b0Copy full SHA for 706f5b0
plotly/utils.py
@@ -35,7 +35,7 @@
35
### incase people are using threading, we lock file reads
36
lock = threading.Lock()
37
38
-PY36 = (
+PY36_OR_LATER = (
39
sys.version_info.major == 3 and sys.version_info.minor >= 6
40
)
41
@@ -289,9 +289,9 @@ def encode_as_numpy(obj):
289
@staticmethod
290
def encode_as_datetime(obj):
291
"""Attempt to convert to utc-iso time string using datetime methods."""
292
- # In PY36, isoformat() converts UTC
+ # Since PY36, isoformat() converts UTC
293
# datetime.datetime objs to UTC T04:00:00
294
- if not (PY36 and (isinstance(obj, datetime.datetime) and
+ if not (PY36_OR_LATER and (isinstance(obj, datetime.datetime) and
295
obj.tzinfo is None)):
296
try:
297
obj = obj.astimezone(pytz.utc)
0 commit comments