[elbe-devel] [PATCH 04/10] shellhelper: Fix Pylint
Christian Teklenborg
chris at linutronix.de
Tue Jun 22 16:52:28 CEST 2021
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>
---
elbepack/shellhelper.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/elbepack/shellhelper.py b/elbepack/shellhelper.py
index 9252bc0f..f33f19b7 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