From 433ab396879167dee63d2de186e2a046c4e10cc1 Mon Sep 17 00:00:00 2001
From: Robert Martin-Legene <robert@martin-legene.dk>
Date: Thu, 10 Dec 2020 19:04:43 -0300
Subject: [PATCH] scoping

---
 bin/libbfa/__init__.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bin/libbfa/__init__.py b/bin/libbfa/__init__.py
index b679f72..61f8f96 100755
--- a/bin/libbfa/__init__.py
+++ b/bin/libbfa/__init__.py
@@ -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
-- 
GitLab