Browse Source

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

(e.g. r.sample.category.py -> r.sample.category)
Tomas Zigo 4 years ago
parent
commit
6ce348188f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      scripts/g.extension/g.extension.py

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

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