diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp
index 5115b6a81da0f771ecbd87f5f6b7de116aa774f6..dbad2b7f2c2b203887c3fd4c2785836153344b88 100644
--- a/Common/OpenFile.cpp
+++ b/Common/OpenFile.cpp
@@ -240,14 +240,6 @@ int ParseFile(const std::string &fileName, bool close, bool warnIfMissing)
 #endif
 }
 
-static int defineSolver(const std::string &name)
-{
-  for(int i = 0; i < 5; i++){
-    if(opt_solver_name(i, GMSH_GET, "") == name) return i;
-  }
-  return 4;
-}
-
 void ParseString(const std::string &str)
 {
   if(str.empty()) return;
@@ -260,6 +252,15 @@ void ParseString(const std::string &str)
   }
 }
 
+static int defineSolver(const std::string &name)
+{
+  for(int i = 0; i < 5; i++){
+    if(opt_solver_name(i, GMSH_GET, "") == name) return i;
+  }
+  opt_solver_name(4, GMSH_SET|GMSH_GUI, name);
+  return 4;
+}
+
 int MergeFile(const std::string &fileName, bool warnIfMissing)
 {
   if(GModel::current()->getName() == ""){
@@ -431,7 +432,6 @@ int MergeFile(const std::string &fileName, bool warnIfMissing)
     status = 1;
     /* tester ceci:
     int num = defineSolver("python");
-    opt_solver_name(num, GMSH_SET, "python");
     opt_solver_executable(num, GMSH_SET, fileName);
     CTX::instance()->launchSolverAtStartup = num;
     return 1;