void-packages/srcpkgs/freecad/patches/151-python-warning.patch

40 lines
2.0 KiB
Diff

diff --git src/Mod/Fem/feminout/importFenicsMesh.py src/Mod/Fem/feminout/importFenicsMesh.py
index 1bb40de..a0b5484 100644
--- src/Mod/Fem/feminout/importFenicsMesh.py
+++ src/Mod/Fem/feminout/importFenicsMesh.py
@@ -154,7 +154,7 @@ def export(objectslist, fileString):
FreeCAD.Console.PrintWarning("Tri6 -> Tri3, Tet10 -> Tet4, etc.\n")
writeFenicsXML.write_fenics_mesh_xml(obj, fileString)
elif fileExtension.lower() == '.xdmf':
- if importToolsFem.get_FemMeshObjectMeshGroups(obj) is not ():
+ if importToolsFem.get_FemMeshObjectMeshGroups(obj):
# if there are groups found, make task panel available
panel = WriteXDMFTaskPanel(obj, fileString)
FreeCADGui.Control.showDialog(panel)
diff --git src/Mod/Fem/feminout/writeFenicsXDMF.py src/Mod/Fem/feminout/writeFenicsXDMF.py
index 9e7f01b..5a93823 100644
--- src/Mod/Fem/feminout/writeFenicsXDMF.py
+++ src/Mod/Fem/feminout/writeFenicsXDMF.py
@@ -258,7 +258,7 @@ def write_fenics_mesh_xdmf(fem_mesh_obj, outputfile, group_values_dict={}, encod
fem_mesh = fem_mesh_obj.FemMesh
gmshgroups = get_FemMeshObjectMeshGroups(fem_mesh_obj)
- if gmshgroups is not ():
+ if gmshgroups:
print('found mesh groups')
for g in gmshgroups:
diff --git src/Mod/PartDesign/WizardShaft/Shaft.py src/Mod/PartDesign/WizardShaft/Shaft.py
index c519b97..8c20eb4 100644
--- src/Mod/PartDesign/WizardShaft/Shaft.py
+++ src/Mod/PartDesign/WizardShaft/Shaft.py
@@ -88,7 +88,7 @@ class Shaft:
# We don't call equilibrium() here because the new segment has no constraints defined yet
# Fix face reference of fixed segment if it is the last one
for i in range(1, len(self.segments)):
- if self.segments[i].constraintType is not "Fixed":
+ if self.segments[i].constraintType != "Fixed":
continue
if i == len(self.segments) - 1:
self.segments[index].constraint.References = [( self.feature.feature, "Face%u" % (2 * (index+1) + 1) )]