Ver código fonte

deploy-ng: Use a more generic method to remove version strings from extension module names

This should help with stripping these strings on Windows.
Mitchell Stokes 9 anos atrás
pai
commit
41556b07fc
1 arquivos alterados com 4 adições e 1 exclusões
  1. 4 1
      direct/src/showutil/dist.py

+ 4 - 1
direct/src/showutil/dist.py

@@ -123,7 +123,10 @@ class build(distutils.command.build.build):
                     basename = module.rsplit('.', 1)[0] + '.' + basename
 
                 # Remove python version string
-                basename = '.'.join([i for i in basename.split('.') if not i.startswith('cpython-')])
+                if sys.version_info >= (3, 0):
+                    parts = basename.split('.')
+                    parts = parts[:-2] + parts[-1:]
+                    basename = '.'.join(parts)
 
                 target_path = os.path.join(builddir, basename)
                 if '.whl/' in source_path: