Skip to content
Snippets Groups Projects
Commit 433ab396 authored by Robert Martin-Legene's avatar Robert Martin-Legene
Browse files

scoping

parent bde3e6ea
No related branches found
No related tags found
No related merge requests found
......@@ -333,6 +333,7 @@ class CompiledContract:
self.writetextfile()
def readtextfile(self):
output = None
for filename in ( '{}.compiled.json'.format(self.name), self.name ):
if os.path.exists( filename ):
with open(filename, 'rt', encoding='utf-8') as infile:
......@@ -340,7 +341,7 @@ class CompiledContract:
break
if output is None:
print("File not found.", file=sys.stderr)
raise FileNotFound
raise FileNotFoundError
if len(output) < 2:
print("The JSON file is too small ({} bytes read from {}).".format(len(output), filename), file=sys.stderr)
raise NameError
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment