-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #247 from pypa/hotfix/246-linker-args-list
Wrap linker arg handling to restore prior expectation.
- Loading branch information
Showing
5 changed files
with
53 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from __future__ import annotations | ||
|
||
from .py38 import removeprefix | ||
|
||
|
||
def consolidate_linker_args(args: list[str]) -> str: | ||
""" | ||
Ensure the return value is a string for backward compatibility. | ||
Retain until at least 2024-04-31. See pypa/distutils#246 | ||
""" | ||
|
||
if not all(arg.startswith('-Wl,') for arg in args): | ||
return args | ||
return '-Wl,' + ','.join(removeprefix(arg, '-Wl,') for arg in args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import sys | ||
|
||
if sys.version_info < (3, 9): | ||
|
||
def removesuffix(self, suffix): | ||
# suffix='' should not call self[:-0]. | ||
if suffix and self.endswith(suffix): | ||
return self[: -len(suffix)] | ||
else: | ||
return self[:] | ||
|
||
def removeprefix(self, prefix): | ||
if self.startswith(prefix): | ||
return self[len(prefix) :] | ||
else: | ||
return self[:] | ||
else: | ||
|
||
def removesuffix(self, suffix): | ||
return self.removesuffix(suffix) | ||
|
||
def removeprefix(self, prefix): | ||
return self.removeprefix(prefix) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters