after trying for a few hours I decided to give up for now. Main issue:
PySys_SetArgvEx has logic that updates the python sys.path and I found replicating that logic to be hard. You'd have to make sure the main file's dir is added to the sys.path, plus anything in PYTHONPATH, plus Python's home directory.
Testing
cli args should work
-i flag should work
should be able to import a library from a sibling .py file
Why?
Want to support python 3.11. But we had some API incompatibilities with the new Python.
Changes
_PyObject_CallNoArg
toPyObject_CallNoArgs
.There are still 2 warnings:
Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *);
Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int)
after trying for a few hours I decided to give up for now. Main issue:
PySys_SetArgvEx
has logic that updates the pythonsys.path
and I found replicating that logic to be hard. You'd have to make sure the main file's dir is added to the sys.path, plus anything in PYTHONPATH, plus Python's home directory.Testing
.py
file