summaryrefslogtreecommitdiffstats
path: root/external/poky/meta/lib/oe/qa.py
diff options
context:
space:
mode:
Diffstat (limited to 'external/poky/meta/lib/oe/qa.py')
-rw-r--r--external/poky/meta/lib/oe/qa.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/external/poky/meta/lib/oe/qa.py b/external/poky/meta/lib/oe/qa.py
index 59c72ce5..ea831b93 100644
--- a/external/poky/meta/lib/oe/qa.py
+++ b/external/poky/meta/lib/oe/qa.py
@@ -1,3 +1,7 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
import os, struct, mmap
class NotELFFileError(Exception):
@@ -37,13 +41,15 @@ class ELFFile:
def __init__(self, name):
self.name = name
self.objdump_output = {}
+ self.data = None
# Context Manager functions to close the mmap explicitly
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
- self.data.close()
+ if self.data:
+ self.data.close()
def open(self):
with open(self.name, "rb") as f: