diff options
author | Patrick Monnerat <[email protected]> | 2023-11-04 01:50:17 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2023-11-18 16:31:16 +0100 |
commit | dac54a63e1aa623df411a6b8f8d4062ba9cd273e (patch) | |
tree | 1f2b7ead5942839f4b04a5d98bf5bf889e840dc3 /src | |
parent | 36feee0291486009329ccfe253caf054d71c09a4 (diff) | |
download | python-caja-dac54a63e1aa623df411a6b8f8d4062ba9cd273e.tar.bz2 python-caja-dac54a63e1aa623df411a6b8f8d4062ba9cd273e.tar.xz |
Python 3.13 removes PySys_SetArgv(): set sys.argv in Python language.
Diffstat (limited to 'src')
-rw-r--r-- | src/caja-python.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/caja-python.c b/src/caja-python.c index 9f213dd..037a6ea 100644 --- a/src/caja-python.c +++ b/src/caja-python.c @@ -191,7 +191,6 @@ caja_python_init_python (void) { PyObject *gi, *require_version, *args, *caja, *descr; GModule *libpython; - wchar_t *argv[] = { L"caja", NULL }; if (Py_IsInitialized()) return TRUE; @@ -209,16 +208,10 @@ caja_python_init_python (void) return FALSE; } - debug("PySys_SetArgv"); - PySys_SetArgv(1, argv); - if (PyErr_Occurred()) - { - PyErr_Print(); - return FALSE; - } - - debug("Sanitize the python search path"); - PyRun_SimpleString("import sys; sys.path = list(filter(None, sys.path))"); + debug("Sanitize the python search path and set sys.argv"); + PyRun_SimpleString("import sys; " + "sys.path = list(filter(None, sys.path)); " + "sys.argv = ['caja']"); if (PyErr_Occurred()) { PyErr_Print(); |