Skip to content

Commit 0142e94

Browse files
Merge pull request #7 from LIHPC-Computational-Geometry/python-3.11_pyframeobject_changes
python-3.11 pyframeobject changes
2 parents c336e10 + bbb8c5d commit 0142e94

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

cmake/version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ set (QT_PYTHON_VERSION ${QT_PYTHON_MAJOR_VERSION}.${QT_PYTHON_MINOR_VERSION}.${Q
1111
# Pour la bibliothèque QtPython3 :
1212
set (QT_PYTHON_3_MAJOR_VERSION "6")
1313
set (QT_PYTHON_3_MINOR_VERSION "4")
14-
set (QT_PYTHON_3_RELEASE_VERSION "1")
14+
set (QT_PYTHON_3_RELEASE_VERSION "2")
1515
set (QT_PYTHON_3_VERSION ${QT_PYTHON_3_MAJOR_VERSION}.${QT_PYTHON_3_MINOR_VERSION}.${QT_PYTHON_3_RELEASE_VERSION})
1616

src/QtPython3/QtPythonConsole.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ static void unregisterConsole (QtPythonConsole& console)
622622

623623
static QtPythonConsole& getConsole (PyFrameObject& frame)
624624
{
625-
const string fileName = PyUnicode_AsUTF8 (frame.f_code->co_filename);
625+
const string fileName = PyUnicode_AsUTF8 (PyFrame_GetCode(&frame)->co_filename);
626626

627627
// Cas particulier : on n'exécute pas un fichier mais une chaîne de caractères => fileName vaut <string>
628628
// ce qui est peu discriminant. On l'accepte si seule une console est enregistrée.
@@ -650,15 +650,15 @@ static int tracePythonExecution (PyObject*, PyFrameObject* frame, int what, PyOb
650650
if (PyTrace_LINE == what) // Evènement "numéro de ligne" modifié (succès et erreur)
651651
{
652652
QtPythonConsole &console = getConsole (*frame);
653-
console.lineProcessedCallback (PyUnicode_AsUTF8 (frame->f_code->co_filename), PyFrame_GetLineNumber (frame), true, string ( ));
653+
console.lineProcessedCallback (PyUnicode_AsUTF8 (PyFrame_GetCode(frame)->co_filename), PyFrame_GetLineNumber (frame), true, string ( ));
654654
} // if (PyTrace_RETURN == what)
655655
else if (PyTrace_EXCEPTION == what) // Ligne en erreur
656656
{
657657
PyObject* pystring = PyObject_Str (obj);
658-
Py_DecRef (pystring);
659658
const string error= PyUnicode_AsUTF8 (pystring);
659+
Py_DecRef (pystring);
660660
QtPythonConsole &console = getConsole (*frame);
661-
console.lineProcessedCallback (PyUnicode_AsUTF8 (frame->f_code->co_filename), PyFrame_GetLineNumber (frame), false, error);
661+
console.lineProcessedCallback (PyUnicode_AsUTF8 (PyFrame_GetCode(frame)->co_filename), PyFrame_GetLineNumber (frame), false, error);
662662
} // if (PyTrace_EXCEPTION == what)
663663
else if (PyTrace_RETURN == what) // Fin du bloc de code avec
664664
{

versions.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Version 6.4.2 : 28/08/24
2+
===============
3+
4+
Correctif plantage console lors de "import numpy".
5+
Portage Python 3.11.
6+
7+
18
Version 6.4.1 : 15/03/24
29
===============
310

0 commit comments

Comments
 (0)