From bd71341ff645e1e4eb7470a5d2a5541e73bf6d5f Mon Sep 17 00:00:00 2001 From: MinRK Date: Mon, 21 Oct 2013 19:54:06 -0700 Subject: [PATCH] cast argv to unicode before testing otherwise the use of `unicode-literals` causes errors when there are non-ascii characters on argv on Python 2. --- lib/matplotlib/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index ab643f03ecb6..930f1ed3b26d 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -243,7 +243,7 @@ class Verbose: # --verbose-silent or --verbose-helpful _commandLineVerbose = None - for arg in sys.argv[1:]: + for arg in map(six.u, sys.argv[1:]): if not arg.startswith('--verbose-'): continue level_str = arg[10:] @@ -1212,7 +1212,7 @@ def tk_window_focus(): # Allow command line access to the backend with -d (MATLAB compatible # flag) -for s in sys.argv[1:]: +for s in map(six.u, sys.argv[1:]): if s.startswith('-d') and len(s) > 2: # look for a -d flag try: use(s[2:])