From fb1ad41835af49eadfb4652100e2fc1d5bbe105a Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 1 Feb 2022 21:59:25 +0000 Subject: Fix sider complaints about single line methods --- SCons/Action.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SCons/Action.py b/SCons/Action.py index e3dfbfd..b7c6bb7 100644 --- a/SCons/Action.py +++ b/SCons/Action.py @@ -799,19 +799,25 @@ def _subproc(scons_env, cmd, error='ignore', **kw): if error == 'raise': raise # return a dummy Popen instance that only returns error class dummyPopen: - def __init__(self, e): self.exception = e + def __init__(self, e): + self.exception = e # Add the following two to enable using the return value as a context manager # for example # with Action._subproc(...) as po: # logic here which uses po + def __enter__(self): return self + def __exit__(self, *args): pass + def communicate(self, input=None): return ('', '') + def wait(self): return -self.exception.errno + stdin = None class f: def read(self): return '' -- cgit v0.12