From 0829b29682b3d73b425ef99f6406e394d3a60015 Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Thu, 9 Nov 2023 13:07:48 -0600 Subject: [PATCH] fix: verson fix --- solcx/install.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/solcx/install.py b/solcx/install.py index e8d9108..3abaece 100644 --- a/solcx/install.py +++ b/solcx/install.py @@ -685,13 +685,17 @@ def _validate_installation(version: Version, solcx_binary_path: Union[Path, str, raise SolcInstallationError( "Downloaded binary would not execute, or returned unexpected output." ) - if Version(installed_version.replace("-nightly", "")).base_version != version.base_version: + + installed_version_clean = Version( + Version(installed_version.replace("-nightly", "")).base_version + ) + if installed_version_clean.base_version != version.base_version: # Without the nightly suffix, it should be the same! _unlink_solc(binary_path) raise UnexpectedVersionError( f"Attempted to install solc v{version}, but got solc v{installed_version}" ) - if Version(installed_version).base_version != version.base_version: + if installed_version_clean not in (version.base_version, f"{version}"): # If it does have the nightly suffix, then only warn. warnings.warn(f"Installed solc version is v{installed_version}", UnexpectedVersionWarning)