-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensured all methods in
setuptools.modified
raise a consistant `dist…
…utils.error.DistutilsError` type (#4567) * Ensured all methods in `setuptools.modified` raise a consistant `distutils.error.DistutilsError` type * Update tests to reflect runtime behaviour with SETUPTOOLS_USE_DISTUTILS=stdlib * Update newsfragments/4567.bugfix.rst Co-authored-by: Anderson Bravalheri <andersonbravalheri+github@gmail.com> * Attempt to fix setuptools/tests/test_distutils_adoption.py * can't use setuptoolsrelative import in test * Fix formatting error --------- Co-authored-by: Anderson Bravalheri <andersonbravalheri+github@gmail.com> Co-authored-by: Anderson Bravalheri <andersonbravalheri@gmail.com>
- Loading branch information
1 parent
884b845
commit 99c75c9
Showing
4 changed files
with
64 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Ensured methods in ``setuptools.modified`` preferably raise a consistent | ||
``distutils.errors.DistutilsError`` type | ||
(except in the deprecated use case of ``SETUPTOOLS_USE_DISTUTILS=stdlib``) | ||
-- by :user:`Avasam` |
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 |
---|---|---|
@@ -1,8 +1,18 @@ | ||
from ._distutils._modified import ( | ||
newer, | ||
newer_group, | ||
newer_pairwise, | ||
newer_pairwise_group, | ||
) | ||
try: | ||
# Ensure a DistutilsError raised by these methods is the same as distutils.errors.DistutilsError | ||
from distutils._modified import ( | ||
newer, | ||
newer_group, | ||
newer_pairwise, | ||
newer_pairwise_group, | ||
) | ||
except ImportError: | ||
# fallback for SETUPTOOLS_USE_DISTUTILS=stdlib, because _modified never existed in stdlib | ||
from ._distutils._modified import ( | ||
newer, | ||
newer_group, | ||
newer_pairwise, | ||
newer_pairwise_group, | ||
) | ||
|
||
__all__ = ['newer', 'newer_pairwise', 'newer_group', 'newer_pairwise_group'] |
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