Skip to content

Commit

Permalink
Fix file desc leak in test_tools_smoke
Browse files Browse the repository at this point in the history
Signed-off-by: Brenden Blanco <[email protected]>
  • Loading branch information
drzaeus77 committed Feb 8, 2018
1 parent 3613ff8 commit c28f6e8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/python/test_tools_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ def run_with_int(self, command, timeout=5, kill_timeout=5,
or (rc == 137 and kill), "rc was %d" % rc)

def kmod_loaded(self, mod):
mods = open("/proc/modules", "r")
reg = re.compile("^%s\s" % mod)
for line in mods:
if reg.match(line):
return 1
return 0
with open("/proc/modules", "r") as mods:
reg = re.compile("^%s\s" % mod)
for line in mods:
if reg.match(line):
return 1
return 0

def setUp(self):
pass
Expand Down

0 comments on commit c28f6e8

Please sign in to comment.