From 75982ed621ce612e9c0797d6df5dfd224f2e268d Mon Sep 17 00:00:00 2001 From: "Marc P. Rostock" Date: Tue, 9 Apr 2019 20:30:22 +0200 Subject: [PATCH] changed PY36 constant naming to be more explicit for versions >=3.6 as suggested by @nicholaskruchten --- plotly/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plotly/utils.py b/plotly/utils.py index a7933863c37..acf1a6fe99c 100644 --- a/plotly/utils.py +++ b/plotly/utils.py @@ -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 ) @@ -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)