mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-19 00:17:51 +02:00
try/except for shlex.join since only available in python 3.8
This commit is contained in:
@ -548,7 +548,10 @@ def main():
|
|||||||
# if magic syntax used, try to run the command and error if it's not found, etc.
|
# if magic syntax used, try to run the command and error if it's not found, etc.
|
||||||
magic_stdout, magic_stderr, magic_exit_code = None, None, 0
|
magic_stdout, magic_stderr, magic_exit_code = None, None, 0
|
||||||
if run_command:
|
if run_command:
|
||||||
run_command_str = shlex.join(run_command)
|
try:
|
||||||
|
run_command_str = shlex.join(run_command) # python 3.8+
|
||||||
|
except AttributeError:
|
||||||
|
run_command_str = join(run_command) # older python versions
|
||||||
|
|
||||||
if valid_command:
|
if valid_command:
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user