diff options
author | 2002-03-24 16:34:21 +0000 | |
---|---|---|
committer | 2002-03-24 16:34:21 +0000 | |
commit | 1ce0073a4e1e5bbc3d710a6c4f1700db6b29827c (patch) | |
tree | 57fb83d8ba926ff729be93098bafd6616688fbb2 /Lib/cmd.py | |
parent | Add local_hostname to SMTP.__init__(). (diff) | |
download | cpython-1ce0073a4e1e5bbc3d710a6c4f1700db6b29827c.tar.gz cpython-1ce0073a4e1e5bbc3d710a6c4f1700db6b29827c.tar.bz2 cpython-1ce0073a4e1e5bbc3d710a6c4f1700db6b29827c.zip |
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
Diffstat (limited to 'Lib/cmd.py')
-rw-r--r-- | Lib/cmd.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/cmd.py b/Lib/cmd.py index 5f955a7c10b..5bbf4bcc7c8 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 |