Repository navigation
Commit 639ada4
committed
Avoid deprecated Py_OptimizeFlag in Py3.12 (GH-5343)
* Work around the deprecation of Py_OptimizeFlag in Py3.12 by reading the value from the interpreter's current PyConfig.
See python/cpython#99872
* Avoid access to PyConfig without holding the GIL when trying to read the old Py_OptimizeFlag. The flag was never meant to be modifiable and thus can be read once at module import time.
See python/cpython#99872 (comment)1 parent 5cef4fa commit 639ada4
4 files changed
Lines changed: 30 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | | - | |
| 422 | + | |
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6214 | 6214 | | |
6215 | 6215 | | |
6216 | 6216 | | |
| 6217 | + | |
| 6218 | + | |
6217 | 6219 | | |
6218 | | - | |
| 6220 | + | |
6219 | 6221 | | |
6220 | 6222 | | |
6221 | 6223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
9 | 35 | | |
10 | 36 | | |
11 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | 448 | | |
453 | 449 | | |
454 | 450 | | |
| |||
0 commit comments