mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-08 06:04:57 +03:00
shlex.join is only available in 3.8+, so only use when present
Fallback is former behaviour of joining with a space.
This commit is contained in:
parent
21a4182b41
commit
5cfd601697
|
@ -974,7 +974,11 @@ def run_command(
|
||||||
cmd_list = command
|
cmd_list = command
|
||||||
# As above, this will usually but not always be correct on Windows, but
|
# As above, this will usually but not always be correct on Windows, but
|
||||||
# is only used for debugging purposes.
|
# is only used for debugging purposes.
|
||||||
cmd_str = shlex.join(command)
|
if hasattr(shlex, "join"):
|
||||||
|
cmd_str = shlex.join(command)
|
||||||
|
else:
|
||||||
|
# shlex.join is more correct, but is only available in 3.8+
|
||||||
|
cmd_str = " ".join(command)
|
||||||
try:
|
try:
|
||||||
cmd_to_run = command if is_windows else cmd_list
|
cmd_to_run = command if is_windows else cmd_list
|
||||||
ret = subprocess.run(
|
ret = subprocess.run(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user