Skip to content

Commit 5080c6b

Browse files
authored
Merge pull request #144 from alanEG/patch-2
Regarding an option "-c" use "/bin/sh" by default
2 parents 8eada87 + 8419c86 commit 5080c6b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Interlace/lib/threader.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import subprocess
2+
import os
23
from concurrent.futures import ThreadPoolExecutor
34
from multiprocessing import Event
4-
55
from tqdm import tqdm
66

7+
import platform
8+
9+
if platform.system().lower() == 'linux':
10+
shell = os.getenv("SHELL") if os.getenv("SHELL") else "/bin/sh"
11+
else:
12+
shell = None
713

814
class Task(object):
915
def __init__(self, command):
@@ -49,7 +55,8 @@ def get_lock(self):
4955
def _run_task(self, t=False):
5056
s = subprocess.Popen(self.task, shell=True,
5157
stdout=subprocess.PIPE,
52-
encoding="utf-8")
58+
encoding="utf-8",
59+
executable=shell)
5360
out, _ = s.communicate()
5461

5562
if out != "":

0 commit comments

Comments
 (0)