From 744c34261f699a3b04230c7404490602211aeb86 Mon Sep 17 00:00:00 2001 From: Andrew Dutcher Date: Tue, 30 May 2017 20:36:33 -0700 Subject: [PATCH] Don't error during sdist if config-host.mak doesn't exist (#846) --- bindings/python/setup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bindings/python/setup.py b/bindings/python/setup.py index 6ea8d2d2..a11b0697 100755 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -92,8 +92,12 @@ def copy_sources(): shutil.copytree(os.path.join(ROOT_DIR, '../../include'), os.path.join(SRC_DIR, 'include/')) # make -> configure -> clean -> clean tests fails unless tests is present shutil.copytree(os.path.join(ROOT_DIR, '../../tests'), os.path.join(SRC_DIR, 'tests/')) - # remove site-specific configuration file - os.remove(os.path.join(SRC_DIR, 'qemu/config-host.mak')) + try: + # remove site-specific configuration file + # might not exist + os.remove(os.path.join(SRC_DIR, 'qemu/config-host.mak')) + except OSError: + pass src.extend(glob.glob(os.path.join(ROOT_DIR, "../../*.[ch]"))) src.extend(glob.glob(os.path.join(ROOT_DIR, "../../*.mk")))