mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
Use isinstance instead of type() comparisons. isinstance is more robust
This commit is contained in:
parent
2192c1eb02
commit
eeaec56ed5
4 changed files with 5 additions and 6 deletions
|
@ -144,7 +144,7 @@ class Debugger(cmd.Cmd):
|
|||
exec(code, globals(), self.scope)
|
||||
except:
|
||||
t, v = sys.exc_info()[:2]
|
||||
if type(t) == type(''):
|
||||
if isinstance(t, str):
|
||||
exc_type_name = t
|
||||
else:
|
||||
exc_type_name = t.__name__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue