mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-21 04:16:12 +00:00
workaround jupyter exception accessing out of bounds argv (#949)
Under certain circumstances the internal argument parser tries to determine the program name via sys.arv[0], however the way we run Cutter and the jupyter integration does not guarantee that argv is set at all, leading to an exception which avoids a proper startup.
This commit is contained in:
parent
30e6498a2c
commit
350375afce
@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import queue
|
import queue
|
||||||
|
import sys
|
||||||
from jupyter_client.ioloop import IOLoopKernelManager
|
from jupyter_client.ioloop import IOLoopKernelManager
|
||||||
from notebook.notebookapp import *
|
from notebook.notebookapp import *
|
||||||
import cutter_internal
|
import cutter_internal
|
||||||
@ -116,6 +117,12 @@ def start_jupyter():
|
|||||||
q = queue.Queue()
|
q = queue.Queue()
|
||||||
|
|
||||||
def start_jupyter_async():
|
def start_jupyter_async():
|
||||||
|
# workaround for misbehavior under certain circumstances
|
||||||
|
# with argumentparser and jupyter accessing out of bounds
|
||||||
|
# program name via argv[0]
|
||||||
|
if not sys.argv:
|
||||||
|
sys.argv.append("Cutter")
|
||||||
|
|
||||||
asyncio.set_event_loop(asyncio.new_event_loop())
|
asyncio.set_event_loop(asyncio.new_event_loop())
|
||||||
app = CutterNotebookApp()
|
app = CutterNotebookApp()
|
||||||
# app.log_level = logging.DEBUG
|
# app.log_level = logging.DEBUG
|
||||||
|
Loading…
Reference in New Issue
Block a user