Browse Source

[Minor] Close file once it is not needed

tags/1.8.1
Mikhail Galanin 5 years ago
parent
commit
e3fc01dad3
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      test/functional/lib/rspamd.py

+ 4
- 4
test/functional/lib/rspamd.py View File

@@ -116,10 +116,10 @@ def path_splitter(path):

def read_log_from_position(filename, offset):
offset = long(offset)
f = open(filename, 'rb')
f.seek(offset)
goo = f.read()
size = len(goo)
with open(filename, 'rb') as f:
f.seek(offset)
goo = f.read()
size = len(goo)
return [goo, size+offset]

def rspamc(addr, port, filename):

Loading…
Cancel
Save