Permalink
Browse files

Fix for issue #621

  • Loading branch information...
1 parent 0d8ff5b commit 0f0629faebdd1683bce1b69a5d7b099afc794a75 @wwitzel3 committed Aug 3, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 pyramid/config/util.py
View
@@ -1,6 +1,8 @@
import re
import traceback
+from functools import update_wrapper
+
from zope.interface import implementer
from pyramid.interfaces import IActionInfo
@@ -59,9 +61,10 @@ def wrapper(self, *arg, **kw):
finally:
self._ainfo.pop()
return result
- wrapper.__name__ = wrapped.__name__
- wrapper.__doc__ = wrapped.__doc__
- wrapper.__docobj__ = wrapped # for sphinx
+
+ if hasattr(wrapped, '__name__'):
+ update_wrapper(wrapper, wrapped)
+ wrapper.__docobj__ = wrapped
return wrapper
def make_predicates(xhr=None, request_method=None, path_info=None,

0 comments on commit 0f0629f

Please sign in to comment.