Draft: LGTM - don't catch BaseException

This commit is contained in:
Chris Hennes
2021-09-19 14:36:38 -05:00
parent 84e86793f0
commit 68a027cf94
5 changed files with 6 additions and 6 deletions

View File

@@ -258,7 +258,7 @@ def geomType(edge):
return "Ellipse"
else:
return "Unknown"
except: # catch all errors, no only TypeError
except Exception: # catch all errors, no only TypeError
return "Unknown"

View File

@@ -297,7 +297,7 @@ class Draft_SetStyle_TaskPanel:
try:
import json
from json.decoder import JSONDecodeError
except:
except Exception:
return
if os.path.exists(PRESETPATH):
with open(PRESETPATH,"r") as f:
@@ -313,7 +313,7 @@ class Draft_SetStyle_TaskPanel:
try:
import json
except:
except Exception:
FreeCAD.Console.PrintError(translate("Draft","Error: json module not found. Unable to save style")+"\n")
return
folder = os.path.dirname(PRESETPATH)

View File

@@ -521,7 +521,7 @@ def calculate_placement(globalRotation,
try:
t = edge.tangentAt(get_parameter_from_v0(edge, offset))
t.normalize()
except:
except Exception:
_wrn(translate("draft","Cannot calculate path tangent. Copy not aligned."))
return placement

View File

@@ -107,7 +107,7 @@ def display_external(internal_value,
uom = unit
internal_value = q.getValueAs(unit)
conversion = 1
except:
except Exception:
conversion = q.getUserPreferred()[1]
uom = q.getUserPreferred()[2]
elif dim == 'Angle':

View File

@@ -210,7 +210,7 @@ def convertToDxf(dwgfilename):
proc = subprocess.Popen(("dwg2dxf", dwgfilename, "-o", result))
proc.communicate()
return result
except:
except Exception:
pass
teigha = getTeighaConverter()