tox: Make sipconfig.py optional in link_pyqt.py.
For some reason sipconfig.py doesn't exist at all on Windows...
This commit is contained in:
parent
1b48dc8749
commit
2a269e9cd9
@ -70,13 +70,16 @@ def link_pyqt(sys_path, venv_path):
|
|||||||
if not globbed_sip:
|
if not globbed_sip:
|
||||||
raise Error("Did not find sip in {}!".format(sys_path))
|
raise Error("Did not find sip in {}!".format(sys_path))
|
||||||
|
|
||||||
files = ['PyQt5', 'sipconfig.py']
|
files = [('PyQt5', True), ('sipconfig.py', False)]
|
||||||
files += [os.path.basename(e) for e in globbed_sip]
|
files += [(os.path.basename(e), True) for e in globbed_sip]
|
||||||
for fn in files:
|
for fn, required in files:
|
||||||
source = os.path.join(sys_path, fn)
|
source = os.path.join(sys_path, fn)
|
||||||
dest = os.path.join(venv_path, fn)
|
dest = os.path.join(venv_path, fn)
|
||||||
if not os.path.exists(source):
|
if not os.path.exists(source):
|
||||||
|
if required:
|
||||||
raise FileNotFoundError(source)
|
raise FileNotFoundError(source)
|
||||||
|
else:
|
||||||
|
continue
|
||||||
if os.path.exists(dest):
|
if os.path.exists(dest):
|
||||||
if os.path.isdir(dest) and not os.path.islink(dest):
|
if os.path.isdir(dest) and not os.path.islink(dest):
|
||||||
shutil.rmtree(dest)
|
shutil.rmtree(dest)
|
||||||
|
Loading…
Reference in New Issue
Block a user