diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 43b4f4bc942f47510fa6d3f485337158568e2fdb..7fd394947787bf920c843649eeadc50105c8e57f 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -1841,6 +1841,14 @@ void GdbEngine::handleListFeatures(const GdbResponse &response)
 }
 
 void GdbEngine::handleHasPython(const GdbResponse &response)
+{
+    if (response.resultClass == GdbResultDone)
+        m_hasPython = true;
+    else
+        pythonDumpersFailed();
+}
+
+void GdbEngine::handlePythonSetup(const GdbResponse &response)
 {
     if (response.resultClass == GdbResultDone) {
         m_hasPython = true;
@@ -1863,8 +1871,6 @@ void GdbEngine::handleHasPython(const GdbResponse &response)
         }
         const GdbMi hasInferiorThreadList = data.findChild("hasInferiorThreadList");
         m_hasInferiorThreadList = (hasInferiorThreadList.data().toInt() != 0);
-    } else {
-        pythonDumpersFailed();
     }
 }
 
@@ -4924,7 +4930,7 @@ void GdbEngine::tryLoadPythonDumpers()
 
     loadInitScript();
 
-    postCommand("bbsetup", ConsoleCommand);
+    postCommand("bbsetup", ConsoleCommand, CB(handlePythonSetup));
 }
 
 void GdbEngine::reloadDebuggingHelpers()
diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h
index c9f932f89caaaf3de6468e6d064c9c279c4fa6bf..a036df656910c747bbc4fb7313c287f9fc901242 100644
--- a/src/plugins/debugger/gdb/gdbengine.h
+++ b/src/plugins/debugger/gdb/gdbengine.h
@@ -391,6 +391,7 @@ protected:
     void handleShowVersion(const GdbResponse &response);
     void handleListFeatures(const GdbResponse &response);
     void handleHasPython(const GdbResponse &response);
+    void handlePythonSetup(const GdbResponse &response);
 
     int m_gdbVersion; // 6.8.0 is 60800
     int m_gdbBuildVersion; // MAC only?