From e31bfb58f050762931bf25bb4ceb896e22408693 Mon Sep 17 00:00:00 2001 From: Jeppe Klitgaard Date: Mon, 6 Apr 2015 01:25:16 +0200 Subject: [PATCH] Now verify-manifest.py is windows-compatible again --- bin/verify-manifest.py | 18 +++++++++--------- tox.ini | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bin/verify-manifest.py b/bin/verify-manifest.py index 32385be..90e58c1 100644 --- a/bin/verify-manifest.py +++ b/bin/verify-manifest.py @@ -1,28 +1,28 @@ """ Exits with exit code 0 if manifest was verified. """ - -from sh import check_manifest -from sh import ErrorReturnCode_1 import sys +import subprocess +import errno +import os EXPECTED_OUTPUT = "lists of files in version control and sdist match" - +os.chdir("..") # Leave bin/ def verify_manifest(): """ Returns a ``str`` containing output from ``check-manifest``. """ try: - output = check_manifest().decode() - except ErrorReturnCode_1 as e: - output = e.stderr.decode() + e.stdout.decode() + output = subprocess.check_output("check-manifest", + stderr=subprocess.STDOUT) + except subprocess.CalledProcessError as e: + output = e.output - return output + return output.decode().strip() if __name__ == '__main__': output = verify_manifest() - print(output) if output == EXPECTED_OUTPUT: diff --git a/tox.ini b/tox.ini index be62c9a..9bba141 100644 --- a/tox.ini +++ b/tox.ini @@ -36,7 +36,7 @@ deps = [testenv:flake8] basepython = python3.4 commands = - flake8 minecraft tests setup.py + flake8 minecraft tests bin/*.py setup.py start.py deps = {[testenv]deps} flake8 @@ -70,7 +70,7 @@ commands = basepython = python3.4 deps = check-manifest - sh +changedir = bin commands = - python {toxinidir}/bin/verify-manifest.py + python verify-manifest.py \ No newline at end of file