Skip to content

Commit

Permalink
avoid shlex.join which was added in Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
taleinat committed Jun 7, 2022
1 parent 1039437 commit 90d6219
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_0_watchmedo.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def test_shell_command_wait_for_completion(tmpdir, capfd):
import sys
import time
script = make_dummy_script(tmpdir, n=1)
trick = ShellCommandTrick(shlex.join([sys.executable, script]), wait_for_process=True)
command = " ".join(map(shlex.quote, [sys.executable, script]))
trick = ShellCommandTrick(command, wait_for_process=True)
assert not trick.is_process_running()
start_time = time.monotonic()
trick.on_any_event(FileModifiedEvent("foo/bar.baz"))
Expand All @@ -97,7 +98,8 @@ def test_shell_command_subprocess_termination_nowait(tmpdir, capfd):
import sys
import time
script = make_dummy_script(tmpdir, n=1)
trick = ShellCommandTrick(shlex.join([sys.executable, script]), wait_for_process=False)
command = " ".join(map(shlex.quote, [sys.executable, script]))
trick = ShellCommandTrick(command, wait_for_process=False)
assert not trick.is_process_running()
trick.on_any_event(FileModifiedEvent("foo/bar.baz"))
assert trick.is_process_running()
Expand Down

0 comments on commit 90d6219

Please sign in to comment.