8000 Merge pull request #2436 from mdboom/locale-explicit-exception · matplotlib/matplotlib@3e61c81 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3e61c81

Browse files
committed
Merge pull request #2436 from mdboom/locale-explicit-exception
Catch explicit exceptions when setting locale.
2 parents 4daa8ca + 29efe3b commit 3e61c81

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/tests/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ def setup():
1515

1616
try:
1717
locale.setlocale(locale.LC_ALL, str('en_US.UTF-8'))
18-
except:
18+
except locale.Error:
1919
try:
2020
locale.setlocale(locale.LC_ALL, str('English_United States.1252'))
21-
except:
21+
except locale.Error:
2222
warnings.warn(
2323
"Could not set locale to English/United States. "
2424
"Some date-related tests may fail")

0 commit comments

Comments
 (0)
0