Commit e417c1c
committed
mgr: set argv for python in PyModuleRegistry
before this change, we setup the progname for Python interpreter,
but setup the argv for it in PyModule. and we are using deprecated
API to initialize Python interpreter.
in this change, let's do this in a single place for better
maintainability. also, take this opportunity, to use the non-deprecated
API to initialize interpreter on Python >= 3.8.
this silence the warning when compiling ceph-mgr with CPython 3.12:
```
/var/ssd/ceph/src/mgr/PyModule.cc: In member function ‘int PyModule::load(PyThreadState*)’:
/var/ssd/ceph/src/mgr/PyModule.cc:363:20: warning: ‘void PySys_SetArgv(int, wchar_t**)’ is deprecated [-Wdeprecated-declarations]
363 | PySys_SetArgv(1, (wchar_t**)argv);
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.12/Python.h:96,
from /var/ssd/ceph/src/mgr/BaseMgrModule.h:4,
from /var/ssd/ceph/src/mgr/PyModule.cc:14:
/usr/include/python3.12/sysmodule.h:13:38: note: declared here
13 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_SetArgv(int, wchar_t **);
| ^~~~~~~~~~~~~
```
Signed-off-by: Kefu Chai <[email protected]>1 parent a21d80c commit e417c1c
2 files changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | 360 | | |
365 | 361 | | |
366 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
73 | 78 | | |
74 | 79 | | |
75 | 80 | | |
| |||
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
| 93 | + | |
| 94 | + | |
88 | 95 | | |
89 | 96 | | |
90 | 97 | | |
| |||
0 commit comments