~freecad-community/freecad-extras/assembly2

« back to all changes in this revision

Viewing changes to assembly2solver.py

  • Committer: looooo
  • Date: 2017-04-29 20:45:27 UTC
  • mto: This revision was merged to the branch mainline in revision 182.
  • Revision ID: git-v1:b1dec62143dc055898bad6a73fb53e87cb9f68e2
py3: exceptions + dict.has_key
except Error msg: --> except Error as msg:
dict.has_key(value) --> value in dict

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
            elif constraintObj.Type == 'sphericalSurface':
109
109
                constraintSystem = VertexUnion(constraintSystem,  *cArgs, constraintValue=0)
110
110
            else:
111
 
                raise NotImplementedError, 'constraintType %s not supported yet' % constraintObj.Type
 
111
                raise NotImplementedError('constraintType %s not supported yet' % constraintObj.Type)
112
112
            if cache:
113
113
                cache.record_levels.append( constraintSystem.numberOfParentSystems() )
114
 
        except Assembly2SolverError, msg:
 
114
        except Assembly2SolverError as e:
115
115
            if printErrors:
116
116
                FreeCAD.Console.PrintError('UNABLE TO SOLVE CONSTRAINTS! info:')
117
 
                FreeCAD.Console.PrintError(msg)
 
117
                FreeCAD.Console.PrintError(e)
118
118
            solved = False
119
119
            break
120
120
        except: