Use isinstance instead of type() comparisons. isinstance is more robust

This commit is contained in:
Toshio Kuratomi 2017-02-16 15:47:09 -08:00
parent 2192c1eb02
commit eeaec56ed5
4 changed files with 5 additions and 6 deletions

View file

@ -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__