Skip to content

Commit a96786c

Browse files
committed
gh-69714: Remove unreachable code (and increase test coverage)
This condition cannot be true. `_locale.setlocale()` from the C module raises `locale.Error` instead of returning `None` for `different_locale.__enter__` (where `self.oldlocale` is set).
1 parent 69c8f4f commit a96786c

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

Lib/calendar.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,6 @@ 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
560558
_locale.setlocale(_locale.LC_TIME, self.oldlocale)
561559

562560

0 commit comments

Comments
 (0)