diff --git a/test.py b/test.py index fa0179f..dfbab67 100644 --- a/test.py +++ b/test.py @@ -9,3 +9,6 @@ def shout(s): def say(s): print(s) + +if __name__ == '__main__': + hello() diff --git a/traceface b/traceface index d138b22..6e8a507 100755 --- a/traceface +++ b/traceface @@ -45,6 +45,8 @@ class Tracer: def run(self, code, run_globals=None): sys.settrace(self.trace_dispatch) try: + exec(compile(open(code, "rb").read(), code, 'exec'), globals()) + except FileNotFoundError: exec(code, run_globals) finally: sys.settrace(None)