Fix file desc leak in test_tools_smoke
@@ -52,7 +52,7 @@ class SmokeTests(TestCase):
or (rc == 137 and kill), "rc was %d" % rc)
def kmod_loaded(self, mod):
- mods = open("/proc/modules", "r")
+ with open("/proc/modules", "r") as mods:
reg = re.compile("^%s\s" % mod)
for line in mods:
if reg.match(line):
