diff --git a/modules/gui/src/python_shell/python_interpreter_worker.cc b/modules/gui/src/python_shell/python_interpreter_worker.cc
index ed1dea231fe219d450cd4c6a4adc718661eaad4d..842b1c4ddf1fd36c3dc47f57c19c4d6b6a1b70ea 100644
--- a/modules/gui/src/python_shell/python_interpreter_worker.cc
+++ b/modules/gui/src/python_shell/python_interpreter_worker.cc
@@ -119,7 +119,7 @@ void PythonInterpreterWorker::run_command_(std::pair<unsigned int,QString> pair)
     current_id_=pair.first;
     QString command=pair.second;
     if(is_simple_expression(command)){
-      bp::object result=bp::eval(bp::str(command.toStdString()),
+      bp::object result=bp::eval(command.toStdString().c_str(),
                                  main_namespace_, main_namespace_);
       String rstring=bp::extract<String>(repr_(result));
       if(rstring!="None"){