Sets the TZPATH variable if it's specified in an environment variable.
()
| 21 | |
| 22 | |
| 23 | def set_tzpath(): |
| 24 | """ |
| 25 | Sets the TZPATH variable if it's specified in an environment variable. |
| 26 | """ |
| 27 | tzpath = os.environ.get('DATEUTIL_TZPATH', None) |
| 28 | |
| 29 | if tzpath is None: |
| 30 | return |
| 31 | |
| 32 | path_components = tzpath.split(':') |
| 33 | |
| 34 | print("Setting TZPATH to {}".format(path_components)) |
| 35 | |
| 36 | from dateutil import tz |
| 37 | tz.TZPATHS.clear() |
| 38 | tz.TZPATHS.extend(path_components) |
| 39 | |
| 40 | |
| 41 | set_tzpath() |
no test coverage detected