From 2a269e9cd9b2865b3448f7a57a62c078f6cb22d8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 27 May 2015 08:10:02 +0200 Subject: [PATCH] tox: Make sipconfig.py optional in link_pyqt.py. For some reason sipconfig.py doesn't exist at all on Windows... --- scripts/link_pyqt.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/link_pyqt.py b/scripts/link_pyqt.py index b6621126d..7c8a77b58 100644 --- a/scripts/link_pyqt.py +++ b/scripts/link_pyqt.py @@ -70,13 +70,16 @@ def link_pyqt(sys_path, venv_path): if not globbed_sip: raise Error("Did not find sip in {}!".format(sys_path)) - files = ['PyQt5', 'sipconfig.py'] - files += [os.path.basename(e) for e in globbed_sip] - for fn in files: + files = [('PyQt5', True), ('sipconfig.py', False)] + files += [(os.path.basename(e), True) for e in globbed_sip] + for fn, required in files: source = os.path.join(sys_path, fn) dest = os.path.join(venv_path, fn) if not os.path.exists(source): - raise FileNotFoundError(source) + if required: + raise FileNotFoundError(source) + else: + continue if os.path.exists(dest): if os.path.isdir(dest) and not os.path.islink(dest): shutil.rmtree(dest)