feat: add null check for input
This commit is contained in:
parent
0ad9676196
commit
f863382d07
1 changed files with 6 additions and 2 deletions
|
@ -39,8 +39,12 @@ def exec(cmd, input=None):
|
|||
else:
|
||||
print(' '.join(cmd))
|
||||
else:
|
||||
subprocess.run(cmd, shell=False, stdout=sys.stdout,
|
||||
stderr=sys.stderr, preexec_fn=preexec, input=input.encode()).returncode
|
||||
if input != None:
|
||||
subprocess.run(cmd, shell=False, stdout=sys.stdout,
|
||||
stderr=sys.stderr, preexec_fn=preexec, input=input.encode()).returncode
|
||||
else:
|
||||
subprocess.run(cmd, shell=False, stdout=sys.stdout,
|
||||
stderr=sys.stderr, preexec_fn=preexec).returncode
|
||||
|
||||
|
||||
def exec_chroot(cmd):
|
||||
|
|
Loading…
Reference in a new issue