File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -214,8 +214,14 @@ class Verbose:
214
214
_commandLineVerbose = None
215
215
216
216
for arg in sys .argv [1 :]:
217
- if not arg .startswith ('--verbose-' ): continue
218
- _commandLineVerbose = arg [10 :]
217
+ if not arg .startswith ('--verbose-' ):
218
+ continue
219
+ level_str = arg [10 :]
220
+ # If it doesn't match one of ours, then don't even
221
+ # bother noting it, we are just a 3rd-party library
222
+ # to somebody else's script.
223
+ if level_str in levels :
224
+ _commandLineVerbose = level_str
219
225
220
226
def __init__ (self ):
221
227
self .set_level ('silent' )
@@ -227,8 +233,10 @@ def set_level(self, level):
227
233
if self ._commandLineVerbose is not None :
228
234
level = self ._commandLineVerbose
229
235
if level not in self .levels :
230
- raise ValueError ('Illegal verbose string "%s". Legal values are %s' % (level , self .levels ))
231
- self .level = level
236
+ warnings .warn ('matplotlib: unrecognized --verbose-* string "%s".'
237
+ ' Legal values are %s' % (level , self .levels ))
238
+ else :
239
+ self .level = level
232
240
233
241
def set_fileo (self , fname ):
234
242
std = {
You can’t perform that action at this time.
0 commit comments