]> granicus.if.org Git - python/commitdiff
fixed test_imaplib failure on Win
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>
Sun, 29 Apr 2012 22:16:46 +0000 (18:16 -0400)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>
Sun, 29 Apr 2012 22:16:46 +0000 (18:16 -0400)
Lib/test/support.py

index 0526b14fdbdf77f54cb7f8eba6866e2d0448c4c9..79293ed335742d4897b145385fe4fb78f7fc6aa4 100644 (file)
@@ -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: