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:
|
else:
|
||||||
print(' '.join(cmd))
|
print(' '.join(cmd))
|
||||||
else:
|
else:
|
||||||
subprocess.run(cmd, shell=False, stdout=sys.stdout,
|
if input != None:
|
||||||
stderr=sys.stderr, preexec_fn=preexec, input=input.encode()).returncode
|
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):
|
def exec_chroot(cmd):
|
||||||
|
|
Loading…
Reference in a new issue