Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9b593ae

Browse filesBrowse files
committed
Merge pull request #2396 from mdboom/locale-try
Try UNIXy and Windowsy ways of setting locale
2 parents 8607047 + 4bdae6b commit 9b593ae
Copy full SHA for 9b593ae

File tree

1 file changed

+11
-1
lines changed
Filter options

1 file changed

+11
-1
lines changed

‎lib/matplotlib/tests/__init__.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/__init__.py
+11-1Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,17 @@ def setup():
1111
# The baseline images are created in this locale, so we should use
1212
# it during all of the tests.
1313
import locale
14-
locale.setlocale(locale.LC_ALL, str('en_US.UTF-8'))
14+
import warnings
15+
16+
try:
17+
locale.setlocale(locale.LC_ALL, str('en_US.UTF-8'))
18+
except:
19+
try:
20+
locale.setlocale(locale.LC_ALL, str('English_United States.1252'))
21+
except:
22+
warnings.warn(
23+
"Could not set locale to English/United States. "
24+
"Some date-related tests may fail")
1525

1626
use('Agg', warn=False) # use Agg backend for these tests
1727

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.