diff options
| author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2012-04-29 22:20:05 (GMT) | 
|---|---|---|
| committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2012-04-29 22:20:05 (GMT) | 
| commit | 934cb18ef5fc99557ab61ec42748e4d4bd6ac6f3 (patch) | |
| tree | 30d573d4f05dbcfa596806908c366da7a93813e0 /Lib/test/support.py | |
| parent | a6df2ee7d084f830f100a5bd563005389d7d20c4 (diff) | |
| parent | b8f02b5a5f1d211d83d6cc2a40a9b798d8dcfee2 (diff) | |
| download | cpython-934cb18ef5fc99557ab61ec42748e4d4bd6ac6f3.zip cpython-934cb18ef5fc99557ab61ec42748e4d4bd6ac6f3.tar.gz cpython-934cb18ef5fc99557ab61ec42748e4d4bd6ac6f3.tar.bz2  | |
merged
Diffstat (limited to 'Lib/test/support.py')
| -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:  | 
