mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-80731: Avoid executing code in except block in cmd (GH-111740)
This commit is contained in:
parent
afac3c9b7e
commit
148af38cd0
4 changed files with 43 additions and 3 deletions
|
@ -210,9 +210,8 @@ class Cmd:
|
|||
if cmd == '':
|
||||
return self.default(line)
|
||||
else:
|
||||
try:
|
||||
func = getattr(self, 'do_' + cmd)
|
||||
except AttributeError:
|
||||
func = getattr(self, 'do_' + cmd, None)
|
||||
if func is None:
|
||||
return self.default(line)
|
||||
return func(arg)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue