diff --git a/src/App/FreeCADInit.py b/src/App/FreeCADInit.py index ea39fd90a..4fe6eed65 100644 --- a/src/App/FreeCADInit.py +++ b/src/App/FreeCADInit.py @@ -37,7 +37,7 @@ import FreeCAD def InitApplications(): try: import sys,os - except: + except ImportError: FreeCAD.PrintError("\n\nSeems the python standard libs are not installed, bailing out!\n\n") raise # Checking on FreeCAD module path ++++++++++++++++++++++++++++++++++++++++++ diff --git a/src/Mod/Material/importFCMat.py b/src/Mod/Material/importFCMat.py index faf4475d9..8fa4fe543 100644 --- a/src/Mod/Material/importFCMat.py +++ b/src/Mod/Material/importFCMat.py @@ -55,7 +55,7 @@ def insert(filename,docname): "called when freecad wants to import a file" try: doc = FreeCAD.getDocument(docname) - except: + except NameError: doc = FreeCAD.newDocument(docname) FreeCAD.ActiveDocument = doc read(filename) diff --git a/src/Mod/Part/MakeBottle.py b/src/Mod/Part/MakeBottle.py index b75096bca..ee3d9370f 100644 --- a/src/Mod/Part/MakeBottle.py +++ b/src/Mod/Part/MakeBottle.py @@ -50,17 +50,14 @@ def makeBottle(myWidth=50.0, myHeight=70.0, myThickness=30.0): zMax = -1.0 for xp in myBody.Faces: - try: - surf = xp.Surface - if type(surf) == Part.Plane: - z = surf.Position.z - if z > zMax: - zMax = z - faceToRemove = xp - except: - continue - - # This doesn't work for any reason + surf = xp.Surface + if type(surf) == Part.Plane: + z = surf.Position.z + if z > zMax: + zMax = z + faceToRemove = xp + + # This doesn't work for any reason myBody = myBody.makeThickness([faceToRemove],-myThickness/50 , 1.e-3) myThreading = Part.makeThread(myNeckHeight/10, myNeckRadius*0.06, myHeight/10, myNeckRadius*0.99) myThreading.translate(Base.Vector(0,0,myHeight)) diff --git a/src/Mod/Sketcher/InitGui.py b/src/Mod/Sketcher/InitGui.py index 09e4c5f4e..860945689 100644 --- a/src/Mod/Sketcher/InitGui.py +++ b/src/Mod/Sketcher/InitGui.py @@ -72,7 +72,7 @@ class SketcherWorkbench ( Workbench ): import Sketcher try: import Profiles - except: + except ImportError: print "Error in Profiles module" def GetClassName(self):