Skip to content

Commit 5789a39

Browse files
committed
Fix bug
1 parent 3b4aab8 commit 5789a39

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

solc/main.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
)
1919

2020
import semantic_version
21-
21+
import platform
2222

2323
VERSION_DEV_DATE_MANGLER_RE = re.compile(r'(\d{4})\.0?(\d{1,2})\.0?(\d{1,2})')
2424
strip_zeroes_from_month_and_day = functools.partial(VERSION_DEV_DATE_MANGLER_RE.sub,
@@ -69,12 +69,14 @@ def _parse_compiler_output(stdoutdata):
6969
sources = output['sources']
7070

7171
for source, data in contracts.items():
72-
if("Windows" in platform.system()):
73-
drive_path = source.split(':')[0]
74-
drive_path + ":\\"+source.split(':')[1].replace("\\", "\\\\")
75-
7672
data['abi'] = json.loads(data['abi'])
77-
data['ast'] = sources[source.split(':')[0]]['AST']
73+
74+
if ("Windows" in platform.system()):
75+
split_source = source.split(':')
76+
windows_path = split_source[0] + ":" + split_source[1]
77+
data['ast'] = sources[windows_path]['AST']
78+
else:
79+
data['ast'] = sources[source.split(':')[0]]['AST']
7880

7981
return contracts
8082

0 commit comments

Comments
 (0)