MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / resource_exists

Function resource_exists

tests/test_code/py/pytz/__init__.py:111–124  ·  view source on GitHub ↗

Return true if the given resource exists

(name)

Source from the content-addressed store, hash-verified

109
110
111def resource_exists(name):
112 """Return true if the given resource exists"""
113 try:
114 if os.environ.get('PYTZ_SKIPEXISTSCHECK', ''):
115 # In "standard" distributions, we can assume that
116 # all the listed timezones are present. As an
117 # import-speed optimization, you can set the
118 # PYTZ_SKIPEXISTSCHECK flag to skip checking
119 # for the presence of the resource file on disk.
120 return True
121 open_resource(name).close()
122 return True
123 except IOError:
124 return False
125
126
127_tzinfo_cache = {}

Callers

nothing calls this directly

Calls 1

open_resourceFunction · 0.85

Tested by

no test coverage detected