summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/qa.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/qa.py')
-rw-r--r--meta/lib/oe/qa.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/lib/oe/qa.py b/meta/lib/oe/qa.py
index 21066c4dc3..ea831b930a 100644
--- a/meta/lib/oe/qa.py
+++ b/meta/lib/oe/qa.py
@@ -41,13 +41,15 @@ class ELFFile:
41 def __init__(self, name): 41 def __init__(self, name):
42 self.name = name 42 self.name = name
43 self.objdump_output = {} 43 self.objdump_output = {}
44 self.data = None
44 45
45 # Context Manager functions to close the mmap explicitly 46 # Context Manager functions to close the mmap explicitly
46 def __enter__(self): 47 def __enter__(self):
47 return self 48 return self
48 49
49 def __exit__(self, exc_type, exc_value, traceback): 50 def __exit__(self, exc_type, exc_value, traceback):
50 self.data.close() 51 if self.data:
52 self.data.close()
51 53
52 def open(self): 54 def open(self):
53 with open(self.name, "rb") as f: 55 with open(self.name, "rb") as f: