From 29efe3b0a150e742c0e2aab2bd2d65ecdb3d01bf Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 18 Sep 2013 11:31:36 -0400 Subject: [PATCH] Explict exceptions when setting locale. --- lib/matplotlib/tests/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/tests/__init__.py b/lib/matplotlib/tests/__init__.py index a1b5b29b0be2..19dc917a59d6 100644 --- a/lib/matplotlib/tests/__init__.py +++ b/lib/matplotlib/tests/__init__.py @@ -15,10 +15,10 @@ def setup(): try: locale.setlocale(locale.LC_ALL, str('en_US.UTF-8')) - except: + except locale.Error: try: locale.setlocale(locale.LC_ALL, str('English_United States.1252')) - except: + except locale.Error: warnings.warn( "Could not set locale to English/United States. " "Some date-related tests may fail")