Skip to content

enforce does not return correct exit code when ran as multiple processes  #250

Open
@MichalAugustyn

Description

@MichalAugustyn

It's very easy to reproduce with one line python file

# testfile.py 
test = range(5)

It's working with a single process

[10:21] () augustyn:tmp$ python -m modernize --enforce testfile.py 
...
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Refactored testfile.py
--- testfile.py	(original)
+++ testfile.py	(refactored)
@@ -1 +1,2 @@
-test = range(5)
+from six.moves import range
+test = list(range(5))
RefactoringTool: Files that need to be modified:
RefactoringTool: testfile.py

[10:21] () augustyn:tmp$ echo $?
2

but not with multiple processes

[10:21] () augustyn:tmp$ python -m modernize --enforce testfile.py  -j 2
...
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Refactored testfile.py
--- testfile.py	(original)
+++ testfile.py	(refactored)
@@ -1 +1,2 @@
-test = range(5)
+from six.moves import range
+test = list(range(5))
RefactoringTool: No files need to be modified.

[10:23] () augustyn:tmp$ echo $?
0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions