[Python-checkins] cpython (3.2): fixed test_imaplib failure on Win

alexander.belopolsky python-checkins at python.org
Mon Apr 30 00:20:20 CEST 2012


http://hg.python.org/cpython/rev/f23222d734bd
changeset:   76651:f23222d734bd
branch:      3.2
parent:      76647:b7e491b9094f
user:        Alexander Belopolsky <alexander.belopolsky at gmail.com>
date:        Sun Apr 29 18:16:46 2012 -0400
summary:
  fixed test_imaplib failure on Win

files:
  Lib/test/support.py |  6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/Lib/test/support.py b/Lib/test/support.py
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -1027,12 +1027,16 @@
 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:

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list