MCPcopy Index your code
hub / github.com/python/cpython / _change_tz

Method _change_tz

Lib/test/datetimetester.py:6897–6904  ·  view source on GitHub ↗
(cls, new_tzinfo)

Source from the content-addressed store, hash-verified

6895 @classmethod
6896 @contextlib.contextmanager
6897 def _change_tz(cls, new_tzinfo):
6898 try:
6899 with os_helper.EnvironmentVarGuard() as env:
6900 env["TZ"] = new_tzinfo
6901 _time.tzset()
6902 yield
6903 finally:
6904 _time.tzset()
6905
6906 @unittest.skipUnless(
6907 hasattr(_time, "tzset"), "time module has no attribute tzset"

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected