diff --git a/check_manifest.py b/check_manifest.py index 752dd6f..4c2e2db 100755 --- a/check_manifest.py +++ b/check_manifest.py @@ -137,9 +137,15 @@ def run(command, encoding=None, decode=True): """ if not encoding: encoding = locale.getpreferredencoding() + if command and command[0] == sys.executable: + # Workaround for zc.buildout, bootstrapped from a Python that lacks + # setuptools (see https://github.com/mgedmin/check-manifest/issues/35) + env = {'PYTHONPATH': os.pathsep.join(sys.path)} + else: + env = None try: pipe = subprocess.Popen(command, stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) + stderr=subprocess.STDOUT, env=env) except OSError as e: raise Failure("could not run %s: %s" % (command, e)) output = pipe.communicate()[0] diff --git a/setup.py b/setup.py index cb630bf..efcef50 100755 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ py_modules=['check_manifest'], zip_safe=False, test_suite='tests.test_suite', - install_requires=[], + install_requires=['setuptools'], extras_require={ 'test': ['mock'], },