From 1ce0073a4e1e5bbc3d710a6c4f1700db6b29827c Mon Sep 17 00:00:00 2001 From: Skip Montanaro Date: Sun, 24 Mar 2002 16:34:21 +0000 Subject: 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 --- Lib/cmd.py | 4 ++-- 1 file 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 -- cgit v0.12