Skip to content

Commit

Permalink
matplotlib.get_home: Removing catch-all except blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgiuca-google committed Apr 16, 2013
1 parent 941efd4 commit ca6cd19
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/matplotlib/__init__.py
Expand Up @@ -479,18 +479,16 @@ def _get_home():
"""
try:
path = os.path.expanduser("~")
except:
except ImportError:
# This happens on Google App Engine (pwd module is not present).
pass
else:
if os.path.isdir(path):
return path
for evar in ('HOME', 'USERPROFILE', 'TMP'):
try:
path = os.environ[evar]
if os.path.isdir(path):
return path
except:
pass
path = os.environ.get(evar)
if path is not None and os.path.isdir(path):
return path
return None


Expand Down

0 comments on commit ca6cd19

Please sign in to comment.