diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2021-08-12 10:28:03 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2021-08-12 13:53:18 +0200 |
commit | bec1cbde23681595952b3604448b323000a2b49e (patch) | |
tree | eff41917641865d00261cb59487ceb8001975239 /xtesting/core/feature.py | |
parent | 569599f5950fcbf9c2c9f0fdf5f4b469babe573a (diff) |
Update pylint to 2.9.6
It stops filtering upper constraints by versions as python 2 (and 3.5)
dropped.
Change-Id: Ieb96d068ebda813e020a093f3291b4a9526402e4
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'xtesting/core/feature.py')
-rw-r--r-- | xtesting/core/feature.py | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/xtesting/core/feature.py b/xtesting/core/feature.py index feae9885..b41519d0 100644 --- a/xtesting/core/feature.py +++ b/xtesting/core/feature.py @@ -107,20 +107,21 @@ class BashFeature(Feature): os.makedirs(self.res_dir) with open(self.result_file, 'w') as f_stdout: self.__logger.info("Calling %s", cmd) - process = subprocess.Popen( - cmd, shell=True, stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - for line in iter(process.stdout.readline, b''): - if console: - sys.stdout.write(line.decode("utf-8")) - f_stdout.write(line.decode("utf-8")) - try: - process.wait(timeout=max_duration) - except subprocess.TimeoutExpired: - process.kill() - self.__logger.info( - "Killing process after %d second(s).", max_duration) - return -2 + with subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) as process: + for line in iter(process.stdout.readline, b''): + if console: + sys.stdout.write(line.decode("utf-8")) + f_stdout.write(line.decode("utf-8")) + try: + process.wait(timeout=max_duration) + except subprocess.TimeoutExpired: + process.kill() + self.__logger.info( + "Killing process after %d second(s).", + max_duration) + return -2 with open(self.result_file, 'r') as f_stdin: self.__logger.debug("$ %s\n%s", cmd, f_stdin.read().rstrip()) return process.returncode |