Return true if the given resource exists
(name)
| 109 | |
| 110 | |
| 111 | def 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 = {} |
nothing calls this directly
no test coverage detected