-
Notifications
You must be signed in to change notification settings - Fork 225
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
Add types to task.py #1254
Add types to task.py #1254
Conversation
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.
i have one comment to confirm. i would like to request another review.
""" | ||
Schedule done callbacks on the executor if possible, else run them directly. | ||
|
||
This function assumes self._lock is not held. | ||
""" | ||
with self._lock: | ||
assert self._executor is not None |
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 check is required here? i think this could be None
.
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.
I believe if self._executor
is None
then an error of 'NoneType' object is not callable
would occur with the line executor = self._executor()
@@ -174,6 +173,7 @@ def add_done_callback(self, callback): | |||
invoke = False | |||
with self._lock: | |||
if self._done: | |||
assert self._executor is not None |
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.
same here, could be None
?
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 looks good to me. I'm going to go ahead and rebase it onto the latest, since it will certainly need that in order to pass CI.
Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>
Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>
Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>
No description provided.