Browse Source

Utils: head_from_fun: Use module of function instead of creating a new name

Ask Solem 8 years ago
parent
commit
3a8aed2ec0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      celery/utils/functional.py

+ 1 - 1
celery/utils/functional.py

@@ -261,7 +261,7 @@ def head_from_fun(fun, bound=False, debug=False):
     )
     if debug:  # pragma: no cover
         print(definition, file=sys.stderr)
-    namespace = {'__name__': 'headof_{0}'.format(name)}
+    namespace = {'__name__': fun.__module__}
     exec(definition, namespace)
     result = namespace[name]
     result._source = definition