Explorar o código

g.extension: fix get add-on module name on Win platform (#1143)

(e.g. r.sample.category.py -> r.sample.category)
Tomas Zigo %!s(int64=4) %!d(string=hai) anos
pai
achega
ef56e0001c
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      scripts/g.extension/g.extension.py

+ 2 - 2
scripts/g.extension/g.extension.py

@@ -1239,10 +1239,10 @@ def install_extension_win(name):
     for r, d, f in os.walk(srcdir):
     for r, d, f in os.walk(srcdir):
         for file in f:
         for file in f:
             if file.endswith('.py'):
             if file.endswith('.py'):
-                modulename = file.rstrip(".py")
+                modulename = file.rsplit('.py')[0]
                 module_list.append(modulename)
                 module_list.append(modulename)
             if file.endswith('.exe'):
             if file.endswith('.exe'):
-                modulename = file.rstrip(".exe")
+                modulename = file.rsplit('.exe')[0]
                 module_list.append(modulename)
                 module_list.append(modulename)
     # remove duplicates in case there are .exe wrappers for python scripts
     # remove duplicates in case there are .exe wrappers for python scripts
     module_list = set(module_list)
     module_list = set(module_list)