-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[10187] Fix IRC ctcpExtract for pypy 3.7.4. #1592
Conversation
| @@ -3678,10 +3678,10 @@ def ctcpExtract(message): | |||
| normal_messages.append(messages.pop(0)) | |||
| odd = not odd | |||
|
|
|||
| extended_messages[:] = filter(None, extended_messages) | |||
| normal_messages[:] = filter(None, normal_messages) | |||
| extended_messages[:] = list(filter(None, extended_messages)) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion is to have something like this
| extended_messages[:] = list(filter(None, extended_messages)) | |
| extended_messages = list(filter(None, extended_messages)) |
I don't know why we need to update the list "in-place"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adiroiban because the two lists are inserted into the retval dictionary earlier. (I'm not sure if it's written that way for a reason... The whole function could probably be tidied up a lot using some list comprehensions, if someone wanted to do that.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah... I see.
so the issue is here
extended_messages = []
normal_messages = []
retval = {"extended": extended_messages, "normal": normal_messages}
and the return dict could have been created at the end with
return {"extended": extended_messages, "normal": normal_messages}
I think that we can live with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The style of ctcpExtract is a bit odd I agree but I don't think it's important to clean it up beyond what's here.
|
I will land this since it's blocking builds. |
|
For reference upstream bug report https://foss.heptapod.net/pypy/pypy/-/issues/3451 |
Scope and purpose
Our CI is failing in trunk after the auto-upgrade to pypy 3.7.4 which uses py3.10.
The IRC tests are failing.
I have found that the source is twisted.words.protocols.irc.ctcpExtract
Contributor Checklist:
tox -e lintto format my patch to meet the Twisted Coding Standard#character).reviewto the keywords field in Trac, and putting a link to this PR in the comment; it shows up in https://twisted.reviews/ now.The first line is automatically generated by GitHub based on PR ID and branch name.
The other lines generated by GitHub should be replaced.