GeezerVison is showing github.com — gh-84683: Check `<prefix>/share/zoneinfo` for zoneinfo files on Windo… · python/cpython@3000594
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: Lib/sysconfig/__init__.py +7-1Lines changed: 7 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -412,7 +412,13 @@ def _init_non_posix(vars): |
412 | 412 | vars['EXE'] = '.exe' |
413 | 413 | vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT |
414 | 414 | vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable)) |
415 | | - vars['TZPATH'] = '' |
| 415 | + # No standard path exists on Windows for this, but we'll check |
| 416 | + # whether someone is imitating a POSIX-like layout |
| 417 | + check_tzpath = os.path.join(vars['prefix'], 'share', 'zoneinfo') |
| 418 | + if os.path.exists(check_tzpath): |
| 419 | + vars['TZPATH'] = check_tzpath |
| 420 | + else: |
| 421 | + vars['TZPATH'] = '' |
416 | 422 |
|
417 | 423 | # |
418 | 424 | # public APIs |
|
Collapse file
Copy file name to clipboard +1Lines changed: 1 addition & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +:mod:`zoneinfo`: Check in ``<prefix>/share/zoneinfo`` for data files on Windows |