diff options
-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 a7d0833..6c96501 100644 --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -1106,12 +1106,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: |