Skip to content

Commit f274b22

Browse files
committed
Fix a warning related to the binary cache
1 parent f6afc5f commit f274b22

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

qiling/loader/pe.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ def load_dll(self, dll_name, driver=False):
6767

6868
if self.libcache and os.path.exists(fcache) and \
6969
os.stat(fcache).st_mtime > os.stat(path).st_mtime: # pickle file cannot be outdated
70-
(data, cmdlines, self.import_symbols, self.import_address_table) = \
71-
pickle.load(open(fcache, "rb"))
70+
with open(fcache, "rb") as fcache_file:
71+
(data, cmdlines, self.import_symbols, self.import_address_table) = \
72+
pickle.load(fcache_file)
7273
for entry in cmdlines:
7374
self.set_cmdline(entry['name'], entry['address'], data)
7475
else:

0 commit comments

Comments
 (0)