Skip to content

Commit c24b196

Browse files
committed
enh: fix the paths using shlex to make the paths work on shell
1 parent 85fb6a4 commit c24b196

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

IDCBrowser/IDCHandlerModule.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import ctk
1919
from idc_index import index
2020
import sys
21+
import shlex
2122

2223
class IDCRequestHandler(BaseRequestHandler):
2324

@@ -230,10 +231,10 @@ def registerCustomProtocol(self):
230231
parent_dir = os.path.dirname(slicer_exec_dir)
231232

232233
# Now, you can construct the path to PythonSlicer
233-
python_path = os.path.join(parent_dir, "bin", "PythonSlicer")
234+
python_path = shlex.quote(os.path.join(parent_dir, "bin", "PythonSlicer"))
234235

235236
current_dir = os.path.dirname(os.path.realpath(__file__))
236-
python_script_path = os.path.join(current_dir,'Resources', 'resolver.py')
237+
python_script_path = shlex.quote(os.path.join(current_dir,'Resources', 'resolver.py'))
237238

238239
def check_macos_slicer_protocol_registration():
239240
plist_path = os.path.expanduser("/Applications/slicer-app.app/Contents/Info.plist")

0 commit comments

Comments
 (0)