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

Commit 5731c8f

Browse files
committed
Handle <stdin> in solc code
1 parent 29ce3a9 commit 5731c8f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ethereum/_solidity.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,10 @@ def solidity_get_contract_data(all_contracts, filepath, contract_name):
267267
try:
268268
contract_data = all_contracts[contract_name]
269269
except:
270-
_, filename = os.path.split(filepath)
270+
if filepath is None:
271+
filename = '<stdin>'
272+
else:
273+
_, filename = os.path.split(filepath)
271274
contract_data = all_contracts[filename + ":" + contract_name]
272275
return contract_data
273276

@@ -278,7 +281,10 @@ def solidity_get_contract_key(all_contracts, filepath, contract_name):
278281
if contract_name in all_contracts:
279282
return contract_name
280283
else:
281-
_, filename = os.path.split(filepath)
284+
if filepath is None:
285+
filename = '<stdin>'
286+
else:
287+
_, filename = os.path.split(filepath)
282288
contract_key = filename + ":" + contract_name
283289
return contract_key if contract_key in all_contracts else None
284290

0 commit comments

Comments
 (0)