Skip to content

Commit 40e0da3

Browse files
committed
Revert "gh-69714: Remove unreachable code (and increase test coverage)"
This reverts commit a96786c.
1 parent 68adf69 commit 40e0da3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/calendar.py

+2
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,8 @@ def __enter__(self):
555555
_locale.setlocale(_locale.LC_TIME, self.locale)
556556

557557
def __exit__(self, *args):
558+
if self.oldlocale is None:
559+
return
558560
_locale.setlocale(_locale.LC_TIME, self.oldlocale)
559561

560562

0 commit comments

Comments
 (0)