Skip to content

Commit 706f5b0

Browse files
Marcjonmmease
Marc
authored andcommitted
changed PY36 constant naming to be more explicit for versions >=3.6
as suggested by @nicholaskruchten (#1509)
1 parent 133df4d commit 706f5b0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: plotly/utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
### incase people are using threading, we lock file reads
3636
lock = threading.Lock()
3737

38-
PY36 = (
38+
PY36_OR_LATER = (
3939
sys.version_info.major == 3 and sys.version_info.minor >= 6
4040
)
4141

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

0 commit comments

Comments
 (0)