summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2002-03-24 16:34:21 (GMT)
committerSkip Montanaro <skip@pobox.com>2002-03-24 16:34:21 (GMT)
commit1ce0073a4e1e5bbc3d710a6c4f1700db6b29827c (patch)
tree57fb83d8ba926ff729be93098bafd6616688fbb2
parentccbb0edf0ed252d9f0af48c4b60424ab814b1402 (diff)
downloadcpython-1ce0073a4e1e5bbc3d710a6c4f1700db6b29827c.zip
cpython-1ce0073a4e1e5bbc3d710a6c4f1700db6b29827c.tar.gz
cpython-1ce0073a4e1e5bbc3d710a6c4f1700db6b29827c.tar.bz2
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
-rw-r--r--Lib/cmd.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/cmd.py b/Lib/cmd.py
index 5f955a7..5bbf4bc 100644
--- a/Lib/cmd.py
+++ b/Lib/cmd.py
@@ -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