Browse Source

#189 use process name to identify spawned process

Falko Schindler 2 năm trước cách đây
mục cha
commit
e8407c08ce
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      nicegui/run.py

+ 2 - 2
nicegui/run.py

@@ -1,5 +1,5 @@
-import inspect
 import logging
+import multiprocessing
 import os
 import sys
 import webbrowser
@@ -58,7 +58,7 @@ def run(*,
     globals.excludes = [e.strip() for e in exclude.split(',')]
     globals.tailwind = tailwind
 
-    if inspect.stack()[-2].filename.endswith('spawn.py'):
+    if multiprocessing.current_process().name != 'MainProcess':
         return
 
     if show: