Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8f02b5

Browse files
committed
fixed test_imaplib failure on Win
1 parent 407b3bd commit b8f02b5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Lib/test/support.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,12 +1027,16 @@ def inner(*args, **kwds):
10271027
def run_with_tz(tz):
10281028
def decorator(func):
10291029
def inner(*args, **kwds):
1030+
try:
1031+
tzset = time.tzset
1032+
except AttributeError:
1033+
raise unittest.SkipTest("tzset required")
10301034
if 'TZ' in os.environ:
10311035
orig_tz = os.environ['TZ']
10321036
else:
10331037
orig_tz = None
10341038
os.environ['TZ'] = tz
1035-
time.tzset()
1039+
tzset()
10361040

10371041
# now run the function, resetting the tz on exceptions
10381042
try:

0 commit comments

Comments
 (0)