Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 204a692

Browse files
committed
handle missing sys.argv for modpython
svn path=/trunk/matplotlib/; revision=795
1 parent 0747f6a commit 204a692

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/matplotlib/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@
147147
import sys, os
148148
import distutils.sysconfig
149149

150+
if not hasattr(sys, 'argv'): # for modpython
151+
sys.argv = ['modpython']
150152

151153
"""
152154
Manage user customizations through a rc file.
@@ -193,9 +195,12 @@ class Verbose:
193195
# parse the verbosity from the command line; flags look like
194196
# --verbose-error or --verbose-helpful
195197
_commandLineVerbose = None
198+
199+
196200
for arg in sys.argv[1:]:
197201
if not arg.startswith('--verbose-'): continue
198202
_commandLineVerbose = arg[10:]
203+
199204

200205

201206
def __init__(self, level):

0 commit comments

Comments
 (0)