mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-22 22:23:57 -06:00
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.
This commit is contained in:
parent
0085660153
commit
e4edd5732f
1 changed files with 3 additions and 3 deletions
|
@ -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__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue