From cc5852b1e42939827b4f13e4413543c779ce53ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Thu, 19 Jan 2023 19:31:48 +0100 Subject: Drop python2 support in code generated from tdedistutils.py. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- src/tdedistutils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tdedistutils.py b/src/tdedistutils.py index 00a5ced..6dad91d 100644 --- a/src/tdedistutils.py +++ b/src/tdedistutils.py @@ -962,7 +962,7 @@ static TDECModule* return_instance( TQWidget *parent, const char *name ) { // Call the factory function. Set up the args. PyObject *pyParent = PyLong_FromVoidPtr(parent); - PyObject *pyName = PyString_FromString(MODULE_NAME); + PyObject *pyName = PyBytes_FromString(MODULE_NAME); // Using NN here is effect gives our references to the arguement away. PyObject *args = Py_BuildValue ("NN", pyParent, pyName); if(pyName && pyParent && args) { @@ -1858,7 +1858,7 @@ extern "C" { PyRun_SimpleString("import sys\n"); PyRun_SimpleString("sys.path.append('"MODULE_DIR"')\n"); - pName = PyString_FromString(modname); + pName = PyBytes_FromString(modname); pModule = PyImport_Import(pName); Py_XDECREF(pName); @@ -1881,8 +1881,8 @@ extern "C" { } else { pArgs = PyTuple_New(2); - pArg1 = PyString_FromString(argv[2]); - pArg2 = PyString_FromString(argv[3]); + pArg1 = PyBytes_FromString(argv[2]); + pArg2 = PyBytes_FromString(argv[3]); PyTuple_SetItem(pArgs, 0, pArg1); PyTuple_SetItem(pArgs, 1, pArg2); -- cgit v1.2.1