catch all exception types instead of only AttributeError
This commit is contained in:
@ -128,7 +128,7 @@ def format_type(obj):
|
||||
tn = typename(obj)
|
||||
try:
|
||||
dtype = obj.dtype
|
||||
except AttributeError:
|
||||
except Exception: # Exception just in case something besides AttributeError is raised
|
||||
return tn
|
||||
else:
|
||||
return f"{dtype} {tn}"
|
||||
@ -136,7 +136,7 @@ def format_type(obj):
|
||||
def format_size(obj):
|
||||
try:
|
||||
return obj.shape
|
||||
except AttributeError:
|
||||
except Exception: # Exception just in case something besides AttributeError is raised
|
||||
try:
|
||||
return len(obj)
|
||||
except TypeError:
|
||||
|
Reference in New Issue
Block a user