1 parent f80d2c7 commit 8299a1bCopy full SHA for 8299a1b
1 file changed
modules/common/badgeware/__init__.py
@@ -64,11 +64,12 @@ def __call__(self, update):
64
65
66
def launch(path):
67
- app = None
68
-
69
def do_exit():
70
- on_exit = getattr(app, "on_exit", None)
71
- return on_exit() if callable(on_exit) else on_exit
+ if path in sys.modules:
+ app = sys.modules[path]
+ on_exit = getattr(app, "on_exit", None)
+ return on_exit() if callable(on_exit) else on_exit
72
+ return None
73
74
def quit_to_launcher(_pin):
75
do_exit()
@@ -84,7 +85,7 @@ def quit_to_launcher(_pin):
84
85
try:
86
os.chdir(path)
87
sys.path.insert(0, path)
- app = __import__(path) # App may block here
88
+ __import__(path) # App may block here
89
90
return do_exit()
91
0 commit comments