Sfoglia il codice sorgente

task decorator: Also preserve docstring as cls.__doc__ (was saved to cls.run.__doc__). Thanks to Sebastjan Trepča)

Ask Solem 15 anni fa
parent
commit
91230aef9e
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      celery/decorators.py

+ 3 - 1
celery/decorators.py

@@ -56,7 +56,9 @@ def task(*args, **options):
             # (this happens in celery.utils.fun_takes_kwargs)
             run.argspec = getargspec(fun)
 
-            cls_dict = dict(options, run=run, __module__=fun.__module__)
+            cls_dict = dict(options, run=run,
+                            __module__=fun.__module__,
+                            __doc__=fun.__doc__)
             return type(fun.__name__, (base, ), cls_dict)()
 
         return _create_task_cls