[elbe-devel] [PATCH v2 04/12] shellhelper: Fix Pylint
Torben Hohn
torben.hohn at linutronix.de
Thu Jul 22 17:10:04 CEST 2021
From: Christian Teklenborg <chris at linutronix.de>
90:7: C0123: (Using type() instead of isinstance() for a typecheck)
157:7: C0123: (Using type() instead of isinstance() for a typecheck)
242:7: C0123: (Using type() instead of isinstance() for a typecheck)
321:7: C0123: (Using type() instead of isinstance() for a typecheck)
Signed-off-by: Christian Teklenborg <chris at linutronix.de>
Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>
---
elbepack/shellhelper.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/elbepack/shellhelper.py b/elbepack/shellhelper.py
index 9252bc0fc..f33f19b7e 100644
--- a/elbepack/shellhelper.py
+++ b/elbepack/shellhelper.py
@@ -87,7 +87,7 @@ def command_out(cmd, stdin=None, output=PIPE, env_add=None):
if env_add:
new_env.update(env_add)
- if type(stdin) == str:
+ if isinstance(stdin, str):
stdin = stdin.encode()
if stdin is None:
@@ -154,7 +154,7 @@ def command_out_stderr(cmd, stdin=None, env_add=None):
if env_add:
new_env.update(env_add)
- if type(stdin) == str:
+ if isinstance(stdin, str):
stdin = stdin.encode()
if stdin is None:
@@ -239,7 +239,7 @@ def do(cmd, allow_fail=False, stdin=None, env_add=None):
if env_add:
new_env.update(env_add)
- if type(stdin) == str:
+ if isinstance(stdin, str):
stdin = stdin.encode()
logging.info(cmd, extra={"context":"[CMD] "})
@@ -318,7 +318,7 @@ def get_command_out(cmd, stdin=None, allow_fail=False, env_add=None):
if env_add:
new_env.update(env_add)
- if type(stdin) == str:
+ if isinstance(stdin, str):
stdin = stdin.encode()
logging.info(cmd, extra={"context":"[CMD] "})
--
2.20.1
More information about the elbe-devel
mailing list