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

Stop using twisted.internet.defer.returnValue #18020

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

cjwatson
Copy link
Contributor

@cjwatson cjwatson commented Dec 10, 2024

defer.returnValue was only needed in Python 2; in Python 3, a simple return is fine.

twisted.internet.defer.returnValue is deprecated as of Twisted 24.7.0.

Most uses of returnValue in synapse were removed a while back; this cleans up some remaining bits.

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct
    (run the linters)

@cjwatson cjwatson requested a review from a team as a code owner December 10, 2024 00:36
@cjwatson cjwatson force-pushed the remove-defer-returnValue branch 2 times, most recently from 7b6abb1 to ca01bfb Compare December 10, 2024 00:38
Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could you quickly fix the linting problems? They're just removing unused imports, but alas I don't have the ability to edit your PR directly.

`defer.returnValue` was only needed in Python 2; in Python 3, a simple
`return` is fine.

`twisted.internet.defer.returnValue` is deprecated as of Twisted 24.7.0.

Most uses of `returnValue` in synapse were removed a while back; this
cleans up some remaining bits.
@cjwatson cjwatson force-pushed the remove-defer-returnValue branch from ca01bfb to 5defc33 Compare December 19, 2024 23:34
@cjwatson
Copy link
Contributor Author

Oh oops, I had the fix for those in my local copy but forgot to commit and push it. Fixed now, thanks.

@cjwatson
Copy link
Contributor Author

I don't know what's going on with the sytest failures. I could be wrong but they look pretty unrelated to my change?

@erikjohnston
Copy link
Member

I don't know what's going on with the sytest failures. I could be wrong but they look pretty unrelated to my change?

Ooops, looks like we broke CI yesterday! Have fixed.

@erikjohnston erikjohnston merged commit d69c00b into element-hq:develop Dec 20, 2024
39 checks passed
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

Successfully merging this pull request may close these issues.

2 participants