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: ...@@ -333,6 +333,7 @@ class CompiledContract:
self.writetextfile() self.writetextfile()
def readtextfile(self): def readtextfile(self):
output = None
for filename in ( '{}.compiled.json'.format(self.name), self.name ): for filename in ( '{}.compiled.json'.format(self.name), self.name ):
if os.path.exists( filename ): if os.path.exists( filename ):
with open(filename, 'rt', encoding='utf-8') as infile: with open(filename, 'rt', encoding='utf-8') as infile:
...@@ -340,7 +341,7 @@ class CompiledContract: ...@@ -340,7 +341,7 @@ class CompiledContract:
break break
if output is None: if output is None:
print("File not found.", file=sys.stderr) print("File not found.", file=sys.stderr)
raise FileNotFound raise FileNotFoundError
if len(output) < 2: if len(output) < 2:
print("The JSON file is too small ({} bytes read from {}).".format(len(output), filename), file=sys.stderr) print("The JSON file is too small ({} bytes read from {}).".format(len(output), filename), file=sys.stderr)
raise NameError 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