Skip to content

Commit 8f54e7d

Browse files
Give partitioner an arg for is_executable()
1 parent b3353e7 commit 8f54e7d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

madoop/mapreduce.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def mapreduce(
4444
is_executable(map_exe)
4545
is_executable(reduce_exe)
4646
if partitioner:
47-
is_executable(partitioner)
47+
is_executable(partitioner, "2")
4848

4949
# Create a tmp directory which will be automatically cleaned up
5050
with tempfile.TemporaryDirectory(prefix="madoop-") as tmpdir:
@@ -157,7 +157,7 @@ def normalize_input_paths(input_path):
157157
return input_paths
158158

159159

160-
def is_executable(exe):
160+
def is_executable(exe, *args):
161161
"""Verify exe is executable and raise exception if it is not.
162162
163163
Execute exe with an empty string input and verify that it returns zero. We
@@ -168,7 +168,7 @@ def is_executable(exe):
168168
exe = pathlib.Path(exe).resolve()
169169
try:
170170
subprocess.run(
171-
str(exe),
171+
[str(exe), *args],
172172
shell=False,
173173
input="".encode(),
174174
stdout=subprocess.PIPE,

0 commit comments

Comments
 (0)