From 74e2d920ae49956ffd70ff8f0c05f1993dc50c7f Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Wed, 5 Jun 2024 14:49:19 +0000 Subject: [PATCH] fix: improve which python executable is being used (#45) * Update the executable being used * Update slack_cli_hooks/hooks/get_hooks.py Co-authored-by: Kazuhiro Sera * Add comment to explain reason behind stringification * Further improve comment --------- Co-authored-by: Kazuhiro Sera --- slack_cli_hooks/hooks/get_hooks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/slack_cli_hooks/hooks/get_hooks.py b/slack_cli_hooks/hooks/get_hooks.py index 801afbe..2894fbd 100644 --- a/slack_cli_hooks/hooks/get_hooks.py +++ b/slack_cli_hooks/hooks/get_hooks.py @@ -1,5 +1,6 @@ #!/usr/bin/env python import json +import sys from slack_cli_hooks.protocol import ( Protocol, MessageBoundaryProtocol, @@ -8,7 +9,9 @@ ) PROTOCOL: Protocol -EXEC = "python3" + +# Wrap sys.executable in quotes to prevent execution failures if a white space is present in the absolute python path +EXEC = f"'{sys.executable}'" or "python3" hooks_payload = {