From 7e13c44d6cd000fa9539276f4779deaea197bd11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Holm?= Date: Mon, 16 Sep 2013 21:42:09 +0200 Subject: [PATCH 1/2] gdbengine: Use python3 compatible method read python code. 'execfile()' does not exist in python3. So reading the file content and executing it is the way to go. This also works for python2. --- src/plugins/debugger/gdb/gdbengine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 8d77d53..8700b6d 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -4962,11 +4962,11 @@ void GdbEngine::tryLoadPythonDumpers() const QByteArray dumperSourcePath = Core::ICore::resourcePath().toLocal8Bit() + "/dumper/"; - postCommand("python execfile('" + dumperSourcePath + "bridge.py')", + postCommand("python exec(open('" + dumperSourcePath + "bridge.py').read())", ConsoleCommand|NonCriticalResponse); - postCommand("python execfile('" + dumperSourcePath + "dumper.py')", + postCommand("python exec(open('" + dumperSourcePath + "dumper.py').read())", ConsoleCommand|NonCriticalResponse); - postCommand("python execfile('" + dumperSourcePath + "qttypes.py')", + postCommand("python exec(open('" + dumperSourcePath + "qttypes.py').read())", ConsoleCommand|NonCriticalResponse); postCommand("python qqStringCutOff = " -- 1.8.3.2