Commit b8f02b5a authored by Alexander Belopolsky's avatar Alexander Belopolsky

fixed test_imaplib failure on Win

parent 407b3bd8
...@@ -1027,12 +1027,16 @@ def run_with_locale(catstr, *locales): ...@@ -1027,12 +1027,16 @@ def run_with_locale(catstr, *locales):
def run_with_tz(tz): def run_with_tz(tz):
def decorator(func): def decorator(func):
def inner(*args, **kwds): def inner(*args, **kwds):
try:
tzset = time.tzset
except AttributeError:
raise unittest.SkipTest("tzset required")
if 'TZ' in os.environ: if 'TZ' in os.environ:
orig_tz = os.environ['TZ'] orig_tz = os.environ['TZ']
else: else:
orig_tz = None orig_tz = None
os.environ['TZ'] = tz os.environ['TZ'] = tz
time.tzset() tzset()
# now run the function, resetting the tz on exceptions # now run the function, resetting the tz on exceptions
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment