- Use "with" with open - Add a module docstring Signed-off-by: John Kacur <jkacur@xxxxxxxxxx> --- rteval/modules/measurement/cyclictest.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py index 8fdd5341794a..4c8d510c4a34 100644 --- a/rteval/modules/measurement/cyclictest.py +++ b/rteval/modules/measurement/cyclictest.py @@ -24,6 +24,7 @@ # including keys needed to generate an equivalently functional executable # are deemed to be part of the source code. # +""" cyclictest.py - object to manage a cyclictest executable instance """ import os import subprocess @@ -254,14 +255,13 @@ class Cyclictest(rtevalModulePrototype): @staticmethod def __get_debugfs_mount(): ret = None - mounts = open('/proc/mounts') - for l in mounts: - field = l.split() - if field[2] == "debugfs": - ret = field[1] - break - mounts.close() - return ret + with open('/proc/mounts') as mounts: + for l in mounts: + field = l.split() + if field[2] == "debugfs": + ret = field[1] + break + return ret def _WorkloadSetup(self): -- 2.36.1