diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2022-07-29 08:35:47 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2022-07-29 08:35:47 +0300 |
commit | ceb987b9c34a30d03f258976839846a472423554 (patch) | |
tree | 9266d3c76dcabc9b5b05f6e7793904eaad08941c /src/snakeoil/dist | |
parent | Revert "distutils_extensions: fix import w/ newer setuptools(?)" (diff) | |
download | snakeoil-ceb987b9c34a30d03f258976839846a472423554.tar.gz snakeoil-ceb987b9c34a30d03f258976839846a472423554.tar.bz2 snakeoil-ceb987b9c34a30d03f258976839846a472423554.zip |
distutils_extensions: fix import w/ newer setuptools
Diffstat (limited to 'src/snakeoil/dist')
-rw-r--r-- | src/snakeoil/dist/distutils_extensions.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/snakeoil/dist/distutils_extensions.py b/src/snakeoil/dist/distutils_extensions.py index 0e5303a9..9f9d8e57 100644 --- a/src/snakeoil/dist/distutils_extensions.py +++ b/src/snakeoil/dist/distutils_extensions.py @@ -51,7 +51,9 @@ if REPODIR is None: REPODIR = os.path.dirname(os.path.abspath(_filename)) break else: - raise ImportError('this module is only meant to be imported in setup.py scripts') + REPODIR = os.getcwd() # try CWD + if not os.path.exists(os.path.join(REPODIR, 'setup.py')): + raise ImportError('this module is only meant to be imported in setup.py scripts') # running under pip PIP = os.path.basename(os.environ.get('_', '')) == 'pip' or REPODIR.split(os.sep)[2].startswith('pip-') |