Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 6fc4a3d

Browse files
LefterisJPkonradkonrad
authored andcommitted
Make combined-json parsing backwards compatible
1 parent a86f9e1 commit 6fc4a3d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ethereum/_solidity.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,12 @@ def compile_contract(filepath, contract_name, libraries=None, combined='bin,abi'
269269
optimize=optimize,
270270
extra_args=extra_args
271271
)
272-
_, filename = os.path.split(filepath)
273-
return all_contracts[filename + ":" + contract_name]
272+
try:
273+
contract_data = all_contracts[contract_name]
274+
except:
275+
_, filename = os.path.split(filepath)
276+
contract_data = all_contracts[filename + ":" + contract_name]
277+
return contract_data
274278

275279

276280
def compile_last_contract(filepath, libraries=None, combined='bin,abi', optimize=True, extra_args=None):

0 commit comments

Comments
 (0)