Commit 1dba017
Fix PyObject_IsInstance error handling in AsyncLazyValue_set_error
Summary:
Two issues fixed:
1. cancelledError() can return nullptr if asyncio.exceptions import
fails; passing nullptr to PyObject_IsInstance is undefined behavior.
2. PyObject_IsInstance returns -1 on error, which is truthy in C,
causing the cancel path to be silently taken on internal errors.
Now we check for nullptr before calling PyObject_IsInstance and properly
propagate -1 errors to the caller.
Reviewed By: yoney
Differential Revision: D96862209
fbshipit-source-id: 4d439ae1d6a931c9387eb68546bc52d794864f7b1 parent 208d664 commit 1dba017
1 file changed
Lines changed: 17 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
496 | 506 | | |
497 | 507 | | |
498 | 508 | | |
499 | 509 | | |
500 | | - | |
| 510 | + | |
501 | 511 | | |
502 | 512 | | |
503 | 513 | | |
| |||
0 commit comments