This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Replace returnValue with return #5736
Merged
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a77fb07
get initial one-liners
hawkowl d852eb8
get the multilines
hawkowl fdb4d6c
run on tests too
hawkowl 7436021
run black
hawkowl 661285e
isort
hawkowl 8943cf8
fix permissions? and docs
hawkowl e11f0be
changelog
hawkowl 7249c6c
fixes
hawkowl dfec79d
Merge branch 'develop' into hawkowl/remove-returnvalue
hawkowl 9ac36b5
Merge remote-tracking branch 'origin/develop' into hawkowl/remove-ret…
hawkowl e208f8a
Merge branch 'develop' into hawkowl/remove-returnvalue
hawkowl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Replace uses of returnValue with plain return, as returnValue is not needed on Python 3. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import re | ||
| import os.path | ||
|
|
||
| from twisted.python.filepath import FilePath | ||
|
|
||
| r = re.compile(rb"defer\.returnValue\((.*)\)$", re.MULTILINE) | ||
| r2 = re.compile(rb"defer\.returnValue\(", re.MULTILINE) | ||
|
|
||
|
|
||
| for dirpath, subdirs, files in os.walk("tests"): | ||
| for x in files: | ||
| x = os.path.join(dirpath, x) | ||
| print(x) | ||
| if x.endswith(".py"): | ||
| file = FilePath(x) | ||
| old = file.getContent() | ||
| new = r.sub(br"return \1", old) | ||
| new = r2.sub(br"return (", new) | ||
|
|
||
| if old != new: | ||
| file.setContent(new) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.