[DRAFT] Catch only Exception, not BaseException
This commit is contained in:
@@ -120,7 +120,7 @@ def get_dxf(obj, direction=None):
|
||||
|
||||
try:
|
||||
d = Drawing.projectToDXF(obj.Shape, direction)
|
||||
except:
|
||||
except Exception:
|
||||
# TODO: trap only specific exception.
|
||||
# Impossible to generate DXF from Shape? Which exception is throw?
|
||||
_wrn("get_dxf: "
|
||||
|
||||
@@ -75,7 +75,7 @@ def get_line_style(line_style, scale):
|
||||
# scale dashes
|
||||
style = ",".join([str(float(d)/scale) for d in style])
|
||||
# print("lstyle ", style)
|
||||
except:
|
||||
except Exception:
|
||||
# TODO: trap only specific exception; what is the problem?
|
||||
# Bad string specification?
|
||||
return "none"
|
||||
|
||||
@@ -183,7 +183,7 @@ def get_text(plane, techdraw,
|
||||
try:
|
||||
_t = text[0].replace("&", "&").replace("<", "<")
|
||||
svg += _t.replace(">", ">")
|
||||
except:
|
||||
except Exception:
|
||||
# TODO: trap only specific exception; what is the problem?
|
||||
# Bad UTF8 string specification? This can be removed
|
||||
# once the code is only used with Python 3.
|
||||
@@ -200,7 +200,7 @@ def get_text(plane, techdraw,
|
||||
try:
|
||||
_t = text[i].replace("&", "&").replace("<", "<")
|
||||
svg += _t.replace(">", ">")
|
||||
except:
|
||||
except Exception:
|
||||
# TODO: trap only specific exception; what is the problem?
|
||||
# Bad UTF8 string specification? This can be removed
|
||||
# once the code is only used with Python 3.
|
||||
|
||||
Reference in New Issue
Block a user