Skip to content

Fix TypeError('cancel() takes exactly one argument (2 given)') with Python 3.9 #368

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

Closed
wants to merge 2 commits into from

Conversation

shadchin
Copy link
Contributor

This fix #361

@@ -163,7 +163,7 @@ cdef class Handle:

return '<' + ' '.join(info) + '>'

def cancel(self):
Copy link
Member

Choose a reason for hiding this comment

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

This is Handle.cancel() which doesn't have the msg parameter.

@@ -3190,7 +3190,7 @@ class _SyncSocketReaderFuture(aio_Future):
self.__sock = sock
self.__loop = loop

def cancel(self):
def cancel(self, msg=None):
Copy link
Member

Choose a reason for hiding this comment

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

We should pass on this parameter to the super call below.

@@ -17,7 +17,7 @@ cdef class UVRequest:
self.done = 1
Py_DECREF(self)

cdef cancel(self):
cdef cancel(self, msg=None):
Copy link
Member

Choose a reason for hiding this comment

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

Again, this is an internal API that shouldn't be changed.

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.

TypeError('cancel() takes exactly one argument (2 given)') with py3.9.0rc2
2 participants