Commit 3686e5b
authored
[lldb] Eliminate (_)Py_IsFinalizing (NFC) (#152226)
Looking at the implementation of `pylifecycle.c` in cpython, finalizing
and initialized are set at the same time. Therefore we can eliminate the
call to `Py_IsFinalizing` and only check `Py_IsInitialized`, which is
part of the stable API.
I converted the check to an assert and confirmed that during my test
suite runs, we never got into the if block. Because we check before
taking the lock, there is an opportunity for a race, but that exact same
race exists with the original code.1 parent 056608a commit 3686e5b
File tree
1 file changed
+3
-16
lines changed- lldb/source/Plugins/ScriptInterpreter/Python
1 file changed
+3
-16
lines changedLines changed: 3 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | 74 | | |
83 | 75 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
92 | 79 | | |
93 | 80 | | |
94 | 81 | | |
| |||
0 commit comments