Skip to content

Commit 18761b5

Browse files
committed
removed 'UTC_EQ_STR', 'UTC_EQ'
1 parent f0052cc commit 18761b5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pandas/_libs/tslibs/timezones.pyx

+7-5
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ cimport numpy as cnp
1818
from numpy cimport int64_t
1919
cnp.import_array()
2020

21-
UTC_EQ_STR = 'Etc/GMT'
22-
UTC_EQ = pytz.timezone(UTC_EQ_STR)
23-
2421
# ----------------------------------------------------------------------
2522
from pandas._libs.tslibs.util cimport is_integer_object, get_nat
2623

@@ -80,8 +77,13 @@ cpdef inline object get_timezone(object tz):
8077
if zone is None:
8178
return tz
8279

83-
# UTC and Etc/GMT are the same timezones
84-
if zone == UTC_EQ or zone == UTC_EQ_STR:
80+
# UTC and Etc/GMT or Etc/GMT+0 are the same timezones
81+
if not isinstance(zone, str):
82+
str_zone = str(zone)
83+
else:
84+
str_zone = zone
85+
86+
if str_zone == 'Etc/GMT' or str_zone == 'Etc/GMT+0':
8587
return UTC
8688
return zone
8789
except AttributeError:

0 commit comments

Comments
 (0)