瀏覽代碼

change python to python3 (#98)

Markus Neteler 5 年之前
父節點
當前提交
cc2f17938d
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      lib/python/script/core.py
  2. 2 2
      lib/python/script/setup.py

+ 1 - 1
lib/python/script/core.py

@@ -201,7 +201,7 @@ def shutil_which(cmd, mode=os.F_OK | os.X_OK, path=None):
             # we assume that PATHEXT contains always '.py'
             pathext.insert(0, '.py')
         # See if the given file matches any of the expected path extensions.
-        # This will allow us to short circuit when given "python.exe".
+        # This will allow us to short circuit when given "python3.exe".
         # If it does match, only test that one, otherwise we have to try
         # others.
         if any(cmd.lower().endswith(ext) for ext in pathext):

+ 2 - 2
lib/python/script/setup.py

@@ -188,9 +188,9 @@ def init(gisbase, dbase='', location='demolocation', mapset='PERMANENT'):
     # Set GRASS_PYTHON and PYTHONPATH to find GRASS Python modules
     if not os.getenv('GRASS_PYTHON'):
         if sys.platform == 'win32':
-            os.environ['GRASS_PYTHON'] = "python.exe"
+            os.environ['GRASS_PYTHON'] = "python3.exe"
         else:
-            os.environ['GRASS_PYTHON'] = "python"
+            os.environ['GRASS_PYTHON'] = "python3"
     
     path = os.getenv('PYTHONPATH')
     etcpy = os.path.join(gisbase, 'etc', 'python')