Commit 2417006
committed
fix(core): return None from handle properties during Python shutdown
During interpreter finalization, `as_py()` calls `PyImport_ImportModule`
which fails because `sys.modules` is being cleared. Guard `make_py()`
with `py_is_finalizing()` to return None gracefully instead of raising.
Also consolidates the `py_is_finalizing()` helper into the shared header,
removing the duplicate definition from resource_handles.cpp.
Closes #1748
Made-with: Cursor1 parent 9b74eaf commit 2417006
File tree
2 files changed
+17
-13
lines changed- cuda_core/cuda/core/_cpp
2 files changed
+17
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 80 | + | |
93 | 81 | | |
94 | 82 | | |
95 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
520 | 533 | | |
521 | 534 | | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
522 | 538 | | |
523 | 539 | | |
524 | 540 | | |
| |||
0 commit comments