Draft: fix LGTM 'Testing for None should use the 'is' operator' alerrts
https://lgtm.com/projects/g/FreeCAD/FreeCAD/alerts/?mode=tree&ruleFocus=7900090
This commit is contained in:
@@ -70,7 +70,7 @@ def draftify(objectslist, makeblock=False, delete=True):
|
||||
for cluster in Part.sortEdges(obj.Shape.Edges):
|
||||
w = Part.Wire(cluster)
|
||||
nobj = draftify_shape(w)
|
||||
if nobj == None:
|
||||
if nobj is None:
|
||||
nobj = App.ActiveDocument.addObject("Part::Feature", obj.Name)
|
||||
nobj.Shape = w
|
||||
newobjlist.append(nobj)
|
||||
|
||||
@@ -465,7 +465,7 @@ def calculatePlacement(shape):
|
||||
pos = shape.BoundBox.Center
|
||||
norm = get_normal(shape)
|
||||
# for backward compatibility with previous getNormal implementation
|
||||
if norm == None:
|
||||
if norm is None:
|
||||
norm = App.Vector(0, 0, 1)
|
||||
pla = App.Placement()
|
||||
pla.Base = pos
|
||||
|
||||
@@ -233,7 +233,7 @@ def offsetWire(wire, dvec, bind=False, occ=False,
|
||||
else:
|
||||
norm = get_normal(wire) # norm = Vector(0, 0, 1)
|
||||
# for backward compatibility with previous getNormal implementation
|
||||
if norm == None:
|
||||
if norm is None:
|
||||
norm = App.Vector(0, 0, 1)
|
||||
|
||||
closed = isReallyClosed(wire)
|
||||
|
||||
@@ -160,7 +160,7 @@ def flattenWire(wire):
|
||||
"""Force a wire to get completely flat along its normal."""
|
||||
n = get_normal(wire)
|
||||
# for backward compatibility with previous getNormal implementation
|
||||
if n == None:
|
||||
if n is None:
|
||||
n = App.Vector(0, 0, 1)
|
||||
|
||||
o = wire.Vertexes[0].Point
|
||||
|
||||
@@ -39,7 +39,7 @@ def make_line(first_param, last_param=None):
|
||||
Parameters
|
||||
----------
|
||||
first_param :
|
||||
Base.Vector -> First point of the line (if p2 == None)
|
||||
Base.Vector -> First point of the line (if p2 is None)
|
||||
Part.LineSegment -> Line is created from the given Linesegment
|
||||
Shape -> Line is created from the give Shape
|
||||
|
||||
|
||||
@@ -446,7 +446,7 @@ def placements_on_path(shapeRotation, pathwire, count, xlate, align,
|
||||
closedpath = DraftGeomUtils.isReallyClosed(pathwire)
|
||||
normal = DraftGeomUtils.get_normal(pathwire)
|
||||
# for backward compatibility with previous getNormal implementation
|
||||
if normal == None:
|
||||
if normal is None:
|
||||
normal = App.Vector(0, 0, 1)
|
||||
|
||||
if forceNormal and normalOverride:
|
||||
|
||||
Reference in New Issue
Block a user