Skip to content

Commit

Permalink
Add multiprocess freeze support to IPython kernel launcher.
Browse files Browse the repository at this point in the history
  • Loading branch information
zuckerruebe committed Oct 26, 2023
1 parent c7b4759 commit 0990ec7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions release/src/launchIPythonKernel.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
"""
Copied from
https://github.com/ipython/ipykernel/blob/515004a331b10dff026b8d81a0571e4cdf1847a3/ipykernel_launcher.py
with some modifications.
"""

import sys
import multiprocessing as _mp
import sys as _sys

if __name__ == "__main__":
# Support freezing using PyInstaller, see
# https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Multiprocessing and
# https://docs.python.org/3/library/multiprocessing.html#multiprocessing.freeze_support
_mp.freeze_support()

# Remove the CWD from sys.path while we load stuff.
# This is added back by InteractiveShellApp.init_path()
if sys.path[0] == "":
del sys.path[0]
if _sys.path[0] == "":
del _sys.path[0]

from ipykernel import kernelapp as app

Expand Down

0 comments on commit 0990ec7

Please sign in to comment.