[DRAFT] Catch only Exception, not BaseException

This commit is contained in:
Chris Hennes
2021-02-10 14:08:56 -06:00
committed by wwmayer
parent 8228d64ac4
commit fe7e45a7de
16 changed files with 26 additions and 26 deletions

View File

@@ -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: "

View File

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

View File

@@ -183,7 +183,7 @@ def get_text(plane, techdraw,
try:
_t = text[0].replace("&", "&amp;").replace("<", "&lt;")
svg += _t.replace(">", "&gt;")
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("&", "&amp;").replace("<", "&lt;")
svg += _t.replace(">", "&gt;")
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.