Browse Source

ExceptionInfo.Traceback should use '__main__' if no '__file__'

Ask Solem 13 years ago
parent
commit
a434d96623
1 changed files with 3 additions and 1 deletions
  1. 3 1
      celery/datastructures.py

+ 3 - 1
celery/datastructures.py

@@ -189,7 +189,9 @@ class _Frame(object):
     Code = _Code
 
     def __init__(self, frame):
-        self.f_globals = {"__file__": frame.f_globals["__file__"]}
+        self.f_globals = {
+            "__file__": frame.f_globals.get("__file__", "__main__")
+        }
         self.f_code = self.Code(frame.f_code)