8000 Try UNIXy and Windowsy ways of setting locale by mdboom · Pull Request #2396 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Try UNIXy and Windowsy ways of setting locale #2396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 9, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion lib/matplotlib/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@ def setup():
# The baseline images are created in this locale, so we should use
# it during all of the tests.
import locale
locale.setlocale(locale.LC_ALL, str('en_US.UTF-8'))
import warnings

try:
locale.setlocale(locale.LC_ALL, str('en_US.UTF-8'))
except:
try:
locale.setlocale(locale.LC_ALL, str('English_United States.1252'))
except:
warnings.warn(
"Could not set locale to English/United States. "
"Some date-related tests may fail")

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

Expand Down
0