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

This should help with stripping these strings on Windows.
This commit is contained in:
Mitchell Stokes 2017-01-05 18:39:11 -08:00
parent fcbc71c91b
commit 41556b07fc
1 changed files with 4 additions and 1 deletions

View File

@ -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: