Kaydet (Commit) 1ce0073a authored tarafından Skip Montanaro's avatar Skip Montanaro

tighten up except - in this context, AttributeError is the only exception

that can be raised - do_help won't be called if arg is not a string
üst ccbb0edf
......@@ -214,13 +214,13 @@ class Cmd:
# XXX check arg syntax
try:
func = getattr(self, 'help_' + arg)
except:
except AttributeError:
try:
doc=getattr(self, 'do_' + arg).__doc__
if doc:
print doc
return
except:
except AttributeError:
pass
print self.nohelp % (arg,)
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment