# that implementation to something that works even in this case...)
origtz = os.environ.get('TZ')
os.environ['TZ'] = "Europe/London"
- time.tzset()
+ if hasattr(time, 'tzset'):
+ time.tzset()
try:
return self._help_test_epoch()
finally:
del os.environ['TZ']
else:
os.environ['TZ'] = origtz
- time.tzset()
+ if hasattr(time, 'tzset'):
+ time.tzset()
def _help_test_epoch(self):
s = time_format.iso_utc_time_to_seconds("1970-01-01T00:00:01")
origtz = os.environ.get('TZ')
os.environ['TZ'] = "UTC"
- time.tzset()
+ if hasattr(time, 'tzset'):
+ time.tzset()
try:
return time.mktime( (year, month, day, hour, minute, second, 0, 1, 0) ) + subsecfloat
finally:
del os.environ['TZ']
else:
os.environ['TZ'] = origtz
- time.tzset()
+ if hasattr(time, 'tzset'):
+ time.tzset()
def parse_duration(s):
orig = s