Commit df5a7d7
authored
Fix
* Fix `pendulum.tz.timezones()` to use system tzdata
Fix the `pendulum.tz.available_timezones()` to use
`available_timezones()` function instead of iterating over the files
in `tzdata` package. This is more in line with PEP 615, as the system
timezone functions will operate on system-provided tzdata when
available, and use the `tzdata` package only if it's not available.
Therefore, the previous code would yield a potentially different list
of timezones than the system actually provides.
Furthermore, Gentoo provides a dummy `tzdata` package that does not
provide any data, since Python always uses system tzdata. This change
is necessary to make pendulum work again on Gentoo.
Fixes #769
* Fix type hints
* Remove unused `_timezones` variable
* Remove unused imports
* Add caching to `timezones()`pendulum.tz.timezones() to use system tzdata (#801)1 parent 6705906 commit df5a7d7
1 file changed
+5
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
| 4 | + | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 14 | | |
20 | 15 | | |
21 | 16 | | |
22 | 17 | | |
23 | | - | |
24 | | - | |
25 | 18 | | |
26 | 19 | | |
27 | 20 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
36 | 24 | | |
37 | 25 | | |
38 | 26 | | |
| |||
0 commit comments