Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MichalAugustyn opened this issue Jun 28, 2021 · 0 comments

Comments

@MichalAugustyn
Copy link

MichalAugustyn commented Jun 28, 2021

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant