mirror of
https://github.com/aljazceru/cowrie.git
synced 2026-01-25 17:14:35 +01:00
use 'with' syntax for open file
This commit is contained in:
@@ -444,9 +444,8 @@ class HTTPProgressDownloader(client.HTTPDownloader):
|
||||
self.curl.fs.getfile(self.fakeoutfile),
|
||||
self.curl.safeoutfile)
|
||||
else:
|
||||
file = open(self.curl.safeoutfile,'r')
|
||||
self.curl.writeln(file.read())
|
||||
file.close()
|
||||
with open(self.curl.safeoutfile, 'r') as f:
|
||||
self.curl.writeln(f.read())
|
||||
|
||||
self.curl.fileName = self.fileName
|
||||
return client.HTTPDownloader.pageEnd(self)
|
||||
|
||||
Reference in New Issue
Block a user