From 1319bfe11c925fc5f28f7fc84ef1fa795705eb7e Mon Sep 17 00:00:00 2001 From: "luz.paz" Date: Tue, 21 Apr 2020 06:35:40 -0400 Subject: [PATCH] LGTM: Fix 'testing equality to None' Testing whether an object is `None` using the `==` operator is inefficient and potentially incorrect. --- src/Mod/Draft/DraftGeomUtils.py | 2 +- src/Mod/Draft/draftguitools/gui_edit.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Draft/DraftGeomUtils.py b/src/Mod/Draft/DraftGeomUtils.py index eb13163993..e90afc6f96 100644 --- a/src/Mod/Draft/DraftGeomUtils.py +++ b/src/Mod/Draft/DraftGeomUtils.py @@ -1428,7 +1428,7 @@ def offsetWire(wire, dvec, bind=False, occ=False, delta = DraftVecUtils.scaleTo(delta, delta.Length/2) # Consider whether generating the 'offset wire' or the 'base wire' - if offsetMode == None: + if offsetMode is None: # Consider if curOrientation and/or curDir match their firstOrientation/firstDir - to determine whether and how to offset the current edge if (curOrientation == firstOrientation) != (curDir == firstDir): # i.e. xor if curAlign in ['Left', 'Right']: diff --git a/src/Mod/Draft/draftguitools/gui_edit.py b/src/Mod/Draft/draftguitools/gui_edit.py index a8c3e3a574..7cb03ddfeb 100644 --- a/src/Mod/Draft/draftguitools/gui_edit.py +++ b/src/Mod/Draft/draftguitools/gui_edit.py @@ -160,7 +160,7 @@ class Edit: editing: Int Index of the editTracker that has been clicked by the user. Tracker selection mechanism is based on it. - if self.editing == None : + if self.editing is None : the user didn't click any node, and next click will be processed as an attempt to start editing operation if self.editing == o or 1 or 2 or 3 etc :