Draft: LGTM - don't catch BaseException
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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':
|
||||
|
||||
@@ -210,7 +210,7 @@ def convertToDxf(dwgfilename):
|
||||
proc = subprocess.Popen(("dwg2dxf", dwgfilename, "-o", result))
|
||||
proc.communicate()
|
||||
return result
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
teigha = getTeighaConverter()
|
||||
|
||||
Reference in New Issue
Block a user