From: Alexander Belopolsky Date: Sun, 29 Apr 2012 22:16:46 +0000 (-0400) Subject: fixed test_imaplib failure on Win X-Git-Tag: v3.3.0a3~27^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8f02b5a5f1d211d83d6cc2a40a9b798d8dcfee2;p=thirdparty%2FPython%2Fcpython.git fixed test_imaplib failure on Win --- diff --git a/Lib/test/support.py b/Lib/test/support.py index 0526b14fdbdf..79293ed33574 100644 --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -1027,12 +1027,16 @@ def run_with_locale(catstr, *locales): def run_with_tz(tz): def decorator(func): def inner(*args, **kwds): + try: + tzset = time.tzset + except AttributeError: + raise unittest.SkipTest("tzset required") if 'TZ' in os.environ: orig_tz = os.environ['TZ'] else: orig_tz = None os.environ['TZ'] = tz - time.tzset() + tzset() # now run the function, resetting the tz on exceptions try: