- Notifications
You must be signed in to change notification settings - Fork 600
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -3190,7 +3190,7 @@ class _SyncSocketReaderFuture(aio_Future): | ||
| self.__sock = sock | ||
| self.__loop = loop | ||
| def cancel(self): | ||
| def cancel(self, msg=None): | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should pass on this parameter to the super call below. | ||
| if self.__sock is not None and self.__sock.fileno() != -1: | ||
| self.__loop.remove_reader(self.__sock) | ||
| self.__sock = None | ||
| @@ -3205,7 +3205,7 @@ class _SyncSocketWriterFuture(aio_Future): | ||
| self.__sock = sock | ||
| self.__loop = loop | ||
| def cancel(self): | ||
| def cancel(self, msg=None): | ||
| if self.__sock is not None and self.__sock.fileno() != -1: | ||
| self.__loop.remove_writer(self.__sock) | ||
| self.__sock = None | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -5,4 +5,4 @@ cdef class UVRequest: | ||
| Loop loop | ||
| cdef on_done(self) | ||
| cdef cancel(self) | ||
| cdef cancel(self, msg=*) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -17,7 +17,7 @@ cdef class UVRequest: | ||
| self.done = 1 | ||
| Py_DECREF(self) | ||
| cdef cancel(self): | ||
| cdef cancel(self, msg=None): | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, this is an internal API that shouldn't be changed. | ||
| # Most requests are implemented using a threadpool. It's only | ||
| # possible to cancel a request when it's still in a threadpool's | ||
| # queue. Once it's started to execute, we have to wait until | ||
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.
This is
Handle.cancel()which doesn't have themsgparameter.