Explorar o código

#189 use process name to identify spawned process

Falko Schindler %!s(int64=2) %!d(string=hai) anos
pai
achega
e8407c08ce
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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: