浏览代码

don't start with ui.run() in interactive mode

Falko Schindler 2 年之前
父节点
当前提交
aa654012d5
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      nicegui/run.py

+ 3 - 0
nicegui/run.py

@@ -42,6 +42,9 @@ def run(self, *,
         binding_refresh_interval: float = 0.1,
         binding_refresh_interval: float = 0.1,
         exclude: str = '',
         exclude: str = '',
         ):
         ):
+    if globals.config.interactive:
+        print('Error: Unexpected ui.run() in interactive mode.', flush=True)
+        sys.exit()
 
 
     if globals.config.interactive or reload == False:  # NOTE: if reload == True we already started uvicorn above
     if globals.config.interactive or reload == False:  # NOTE: if reload == True we already started uvicorn above
         if show:
         if show: