8000 removing attempt to import pytz · gmiretti/server-client-python@a15a8f5 · GitHub
[go: up one dir, main page]

Skip to content

Commit a15a8f5

Browse files
author
Russell Hay
committed
removing attempt to import pytz
1 parent 898526d commit a15a8f5

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

tableauserverclient/datetime_helpers.py

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
import datetime
22

3-
try:
4-
from pytz import utc
5-
except ImportError:
6-
# If pytz is not installed, let's polyfill a UTC timezone so it all just works
7-
# This code below is from the python documentation for tzinfo: https://docs.python.org/2.3/lib/datetime-tzinfo.html
8-
ZERO = datetime.timedelta(0)
9-
HOUR = datetime.timedelta(hours=1)
103

11-
# A UTC class.
4+
# This code below is from the python documentation for tzinfo: https://docs.python.org/2.3/lib/datetime-tzinfo.html
5+
ZERO = datetime.timedelta(0)
6+
HOUR = datetime.timedelta(hours=1)
127

13-
class UTC(datetime.tzinfo):
14-
"""UTC"""
8+
# A UTC class.
159

16-
def utcoffset(self, dt):
17-
return ZERO
10+
class UTC(datetime.tzinfo):
11+
"""UTC"""
1812

19-
def tzname(self, dt):
20-
return "UTC"
13+
def utcoffset(self, dt):
14+
return ZERO
2115

22-
def dst(self, dt):
23-
return ZERO
16+
def tzname(self, dt):
17+
return "UTC"
2418

25-
utc = UTC()
19+
def dst(self, dt):
20+
return ZERO
21+
22+
utc = UTC()
2623

2724
TABLEAU_DATE_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
2825

0 commit comments

Comments
 (0)
0