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 5ca8042

Browse filesBrowse files
committed
different fix for comparing sys.argv and unicode literals
cast literals to str instead of inappropriate use of six.u (#2534)
1 parent 6cf05d0 commit 5ca8042
Copy full SHA for 5ca8042

File tree

Expand file treeCollapse file tree

1 file changed

+9
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-5
lines changed

‎lib/matplotlib/__init__.py

Copy file name to clipboardExpand all lines: lib/matplotlib/__init__.py
+9-5Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def _forward_ilshift(self, other):
180180

181181

182182
if not hasattr(sys, 'argv'): # for modpython
183-
sys.argv = ['modpython']
183+
sys.argv = [str('modpython')]
184184

185185

186186
from matplotlib.rcsetup import (defaultParams,
@@ -249,8 +249,10 @@ class Verbose:
249249
# --verbose-silent or --verbose-helpful
250250
_commandLineVerbose = None
251251

252-
for arg in map(six.u, sys.argv[1:]):
253-
if not arg.startswith('--verbose-'):
252+
for arg in sys.argv[1:]:
253+
# cast to str because we are using unicode_literals,
254+
# and argv is always str
255+
if not arg.startswith(str('--verbose-')):
254256
continue
255257
level_str = arg[10:]
256258
# If it doesn't match one of ours, then don't even
@@ -1282,8 +1284,10 @@ def tk_window_focus():
12821284
# Allow command line access to the backend with -d (MATLAB compatible
12831285
# flag)
12841286

1285-
for s in map(six.u, sys.argv[1:]):
1286-
if s.startswith('-d') and len(s) > 2: # look for a -d flag
1287+
for s in sys.argv[1:]:
1288+
# cast to str because we are using unicode_literals,
1289+
# and argv is always str
1290+
if s.startswith(str('-d')) and len(s) > 2: # look for a -d flag
12871291
try:
12881292
use(s[2:])
12891293
except (KeyError, ValueError):

0 commit comments

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