diff options
author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2012-04-29 22:16:46 (GMT) |
---|---|---|
committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2012-04-29 22:16:46 (GMT) |
commit | b8f02b5a5f1d211d83d6cc2a40a9b798d8dcfee2 (patch) | |
tree | 3db581d8da8c896b2eae4c67d49dff9e347fdf76 /Lib/test | |
parent | 407b3bd89b877c198bf9cdbf290ddb91b49910b5 (diff) | |
download | cpython-b8f02b5a5f1d211d83d6cc2a40a9b798d8dcfee2.zip cpython-b8f02b5a5f1d211d83d6cc2a40a9b798d8dcfee2.tar.gz cpython-b8f02b5a5f1d211d83d6cc2a40a9b798d8dcfee2.tar.bz2 |
fixed test_imaplib failure on Win
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/support.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py index 0526b14..79293ed 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: |