Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2019-09-17 10:35:12 +0300
committerGhostkeeper <rubend@tutanota.com>2019-09-17 10:35:12 +0300
commite4edd5732f18a4a707c80d7d7ff8a8b96c636527 (patch)
treea4dd3256f2a901b745feba323517c400a8c49c8f /run_mypy.py
parent008566015394a5fb70c8fdd7188594a496cb4541 (diff)
Fix success code in MyPy script
The 'return' variable was used for two things, shadowing each other. Because of that, it would fill the variable with a subprocess.run result which would evaluate to True so it would always say that the test failed.
Diffstat (limited to 'run_mypy.py')
-rw-r--r--run_mypy.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/run_mypy.py b/run_mypy.py
index 62984bce27..c32484a47b 100644
--- a/run_mypy.py
+++ b/run_mypy.py
@@ -61,7 +61,7 @@ def main():
plugins.sort()
mods = ["cura"] + plugins + findModules("plugins/VersionUpgrade")
- result = 0
+ success_code = 0
for mod in mods:
print("------------- Checking module {mod}".format(**locals()))
if sys.platform == "win32":
@@ -70,10 +70,10 @@ def main():
result = subprocess.run([sys.executable, mypy_module, "-p", mod, "--ignore-missing-imports"])
if result.returncode != 0:
print("\nModule {mod} failed checking. :(".format(**locals()))
- result = 1
+ success_code = 1
else:
print("\n\nDone checking. All is good.")
- return result
+ return success_code
if __name__ == "__main__":