From 2f440b460f3c98f1fb639c494c795eb087f22e09 Mon Sep 17 00:00:00 2001 From: iamdefinitelyahuman Date: Tue, 31 Dec 2019 02:19:38 +0200 Subject: [PATCH] bugfixes --- solcx/install.py | 2 +- tests/conftest.py | 3 ++- tests/test_locks.py | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/solcx/install.py b/solcx/install.py index 7f71dc9..405e07a 100644 --- a/solcx/install.py +++ b/solcx/install.py @@ -300,7 +300,7 @@ def _download_solc(url, show_progress): def _install_solc_linux(version, show_progress): download = DOWNLOAD_BASE.format(version, "solc-static-linux") - binary_path = _check_for_installed_version(version, show_progress) + binary_path = _check_for_installed_version(version) if binary_path: LOGGER.info("Downloading solc {} from {}".format(version, download)) content = _download_solc(download, show_progress) diff --git a/tests/conftest.py b/tests/conftest.py index e753f67..a7c2357 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -45,7 +45,8 @@ def nosolc(): temp_path = path.parent.joinpath('.temp') path.rename(temp_path) yield - shutil.rmtree(path) + if path.exists(): + shutil.rmtree(path) temp_path.rename(path) diff --git a/tests/test_locks.py b/tests/test_locks.py index c2b5274..8e044f7 100644 --- a/tests/test_locks.py +++ b/tests/test_locks.py @@ -32,8 +32,9 @@ def test_threadlock(nosolc): def test_processlock(nosolc): - mp.set_start_method('spawn') - threads = [mp.Process(target=solcx.install_solc, args=('0.5.0',),) for i in range(4)] + # have to use a context here to prevent a conflict with tqdm + ctx = mp.get_context('spawn') + threads = [ctx.Process(target=solcx.install_solc, args=('0.5.0',),) for i in range(4)] for t in threads: t.start() solcx.install_solc('0.5.0')