MCPcopy Index your code
hub / github.com/python-pendulum/pendulum / _tz_from_env

Function _tz_from_env

src/pendulum/tz/local_timezone.py:227–240  ·  view source on GitHub ↗
(tzenv: str)

Source from the content-addressed store, hash-verified

225
226
227def _tz_from_env(tzenv: str) -> Timezone:
228 if tzenv[0] == ":":
229 tzenv = tzenv[1:]
230
231 # TZ specifies a file
232 if os.path.isfile(tzenv):
233 with open(tzenv, "rb") as f:
234 return Timezone.from_file(f)
235
236 # TZ specifies a zoneinfo zone.
237 try:
238 return Timezone(tzenv)
239 except ValueError:
240 raise

Callers 1

_get_unix_timezoneFunction · 0.85

Calls 1

TimezoneClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…