Commit b8dd4ab
authored
gh-155245: Fix calendar failing to import when strftime rejects %OB
The strftime() call for standalone month names ('%OB'/'%Ob') is evaluated lazily inside set(), outside the try/except that guards the initial _localized_month construction. On platforms where '%O' is accepted at construction but rejected when actually formatting (e.g. under Wine), this raised an uncaught ValueError. Wrap the set() comparisons in their own try/except so we fall back to month_name/month_abbr in that case too.1 parent af930c1 commit b8dd4ab
1 file changed
Lines changed: 14 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
160 | 167 | | |
161 | 168 | | |
162 | 169 | | |
| |||
0 commit comments