From a00769bebf080384435347aaadeace84f24fc9b8 Mon Sep 17 00:00:00 2001 From: "luz.paz" Date: Mon, 16 Dec 2019 22:56:04 -0500 Subject: [PATCH] LGTM: remove unnecessary 'pass' statements Issue: A pass statement is only necessary when it is the only statement in a block (the list of statements forming part of a compound statement). This is because the purpose of the pass statement is to allow empty blocks where they would otherwise be syntactically invalid. If the block already contains other statements then the pass statement is unnecessary. Recommendation: Remove the pass statement. Relevant links: https://lgtm.com/projects/g/FreeCAD/FreeCAD/snapshot/1a82a5e136d24ed9862c0fd7e41070049a23fa32/files/src/Mod/Import/stepZ.py?sort=name&dir=ASC&mode=heatmap#x78f479c31a062553:1 https://lgtm.com/projects/g/FreeCAD/FreeCAD/snapshot/1a82a5e136d24ed9862c0fd7e41070049a23fa32/files/src/Mod/OpenSCAD/OpenSCADCommands.py#xad4868ffcdf82498:1 https://lgtm.com/projects/g/FreeCAD/FreeCAD/snapshot/1a82a5e136d24ed9862c0fd7e41070049a23fa32/files/src/App/FreeCADInit.py#x9034ec6815c48e38:1 --- src/App/FreeCADInit.py | 1 - src/Mod/Import/stepZ.py | 1 - src/Mod/OpenSCAD/OpenSCADCommands.py | 1 - 3 files changed, 3 deletions(-) diff --git a/src/App/FreeCADInit.py b/src/App/FreeCADInit.py index 50563e3333..93173ef67b 100644 --- a/src/App/FreeCADInit.py +++ b/src/App/FreeCADInit.py @@ -192,7 +192,6 @@ def InitApplications(): PathEnvironment += path + os.pathsep except UnicodeDecodeError: Wrn('Filter invalid module path: u{}\n'.format(repr(path))) - pass # new paths must be prepended to avoid to load a wrong version of a library try: diff --git a/src/Mod/Import/stepZ.py b/src/Mod/Import/stepZ.py index 29a8916976..2d29fb81a9 100644 --- a/src/Mod/Import/stepZ.py +++ b/src/Mod/Import/stepZ.py @@ -105,7 +105,6 @@ def import_stpz(fn,fc,doc): os.remove(tempfilepath) except OSError: sayzerr("error on removing "+tempfilepath+" file") - pass ### def open(filename,doc=None): diff --git a/src/Mod/OpenSCAD/OpenSCADCommands.py b/src/Mod/OpenSCAD/OpenSCADCommands.py index 30f45add66..f421fea7a8 100644 --- a/src/Mod/OpenSCAD/OpenSCADCommands.py +++ b/src/Mod/OpenSCAD/OpenSCADCommands.py @@ -327,7 +327,6 @@ class OpenSCADMeshBooleanWidget(QtGui.QWidget): class OpenSCADMeshBooleanTask: def __init__(self): - pass self.form = OpenSCADMeshBooleanWidget() self.form.buttonadd.clicked.connect(self.doboolean) def getStandardButtons(self):