RefactoringRope/RefactoringServer.py

branch
eric7
changeset 394
b34f5dd3db27
parent 392
b9b0a462123d
child 396
933b8fcd854f
diff -r 8b554b390d6f -r b34f5dd3db27 RefactoringRope/RefactoringServer.py
--- a/RefactoringRope/RefactoringServer.py	Mon Oct 17 08:37:28 2022 +0200
+++ b/RefactoringRope/RefactoringServer.py	Mon Oct 17 16:45:23 2022 +0200
@@ -2107,7 +2107,7 @@
         )
         if res:
             src = self.__defaultConfig()
-            cname = self.__ropeConfigFile()
+            cname = self.__ropeConfigFile(writing=True)
             if src != "" and cname is not None:
                 try:
                     with open(cname, "w") as f:
@@ -2221,10 +2221,12 @@
         # keys: RopeFolderName, DefaultConfig, RopeHelpFile,
         #       RopeInfo, RopeVersion, RopeCopyright, PythonVersion
 
-    def __ropeConfigFile(self):
+    def __ropeConfigFile(self, writing=False):
         """
         Private method to get the name of the rope configuration file.
 
+        @param writing flag indicating to get the name for writing (defaults to False)
+        @type bool (optional)
         @return name of the rope configuration file
         @rtype str
         """
@@ -2233,7 +2235,7 @@
             ropedir = self.__ropeConfig["RopeFolderName"]
             if ropedir:
                 configfile = os.path.join(ropedir, "config.py")
-                if not os.path.exists(configfile):
+                if not writing and not os.path.exists(configfile):
                     configfile = None
         return configfile
 
@@ -2321,7 +2323,7 @@
                     else:
                         clientEnv["PATH"] = execPath
             else:
-                interpreter = ""
+                interpreter = Globals.getPythonExecutable()
             if interpreter:
                 if isRemote:
                     self.__ui.appendToStderr(

eric ide

mercurial