Gui: remove Py2 code from several src/Gui .cpp files

This commit is contained in:
luz paz
2021-04-12 10:56:27 -04:00
committed by wmayer
parent cc7f36599e
commit a213071c87
10 changed files with 1 additions and 191 deletions

View File

@@ -437,11 +437,7 @@ void PythonDebugger::runFile(const QString& fn)
dict = PyModule_GetDict(module);
dict = PyDict_Copy(dict);
if (PyDict_GetItemString(dict, "__file__") == NULL) {
#if PY_MAJOR_VERSION >= 3
PyObject *f = PyUnicode_FromString((const char*)pxFileName);
#else
PyObject *f = PyString_FromString((const char*)pxFileName);
#endif
if (f == NULL) {
fclose(fp);
return;
@@ -580,11 +576,7 @@ int PythonDebugger::tracer_callback(PyObject *obj, PyFrameObject *frame, int wha
//no = frame->f_tstate->recursion_depth;
//std::string funcname = PyString_AsString(frame->f_code->co_name);
#if PY_MAJOR_VERSION >= 3
QString file = QString::fromUtf8(PyUnicode_AsUTF8(frame->f_code->co_filename));
#else
QString file = QString::fromUtf8(PyString_AsString(frame->f_code->co_filename));
#endif
switch (what) {
case PyTrace_CALL:
self->depth++;