We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b41b82 commit 5050d30Copy full SHA for 5050d30
studio/debugtools/debugger.py
@@ -2,6 +2,8 @@
2
# Copyright (C) 2022 Hoverset Group. #
3
# ======================================================================= #
4
5
+_global_freeze = dict(globals())
6
+
7
import sys
8
import tkinter
9
import logging
@@ -197,7 +199,10 @@ def run(cls, path=None):
197
199
cls._hook()
198
200
with open(path) as file:
201
code = compile(file.read(), path, 'exec')
- exec(code, {'__name__': '__main__'})
202
203
+ # Ensure hooked application thinks it is running as __main__
204
+ _global_freeze.update({"__name__": "__main__", "__file__": path})
205
+ exec(code, _global_freeze)
206
207
@classmethod
208
def run_process(cls, path) -> subprocess.Popen:
0 commit comments