Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extension suffix when applying initFunctions for Linux. #20

Open
wants to merge 2 commits into
base: 3.9
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Lib/rebuildpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import ctypes
import distutils
import distutils.ccompiler
from importlib import machinery
import fnmatch
import json
import os
Expand Down Expand Up @@ -131,7 +132,12 @@ def run_rebuild():
if platform.system() != "Windows" and filename.startswith("lib"):
filename = filename[3:]
if filename.endswith(".a"):
filename = filename[:-2]
if platform.system() == "Linux":
ext_suffixes = machinery.all_suffixes()
linux_ext_suffix = ext_suffixes[2][:-3]
filename = filename.split(linux_ext_suffix)[0]
else:
filename = filename[:-2]
if filename.endswith(".lib"):
filename = filename[:-4]
if ext_suffix and filename.endswith(ext_suffix):
Expand Down