Fix doc string injection of deprecated wrapper

This commit is contained in:
Johannes Schönberger
2013-05-26 12:20:06 +02:00
parent db4ef53299
commit f7959e3f07
+3 -3
View File
@@ -27,9 +27,9 @@ class deprecated(object):
alt_msg = ''
if self.alt_func is not None:
alt_msg = ' Use `%s` instead.' % self.alt_func
alt_msg = ' Use ``%s`` instead.' % self.alt_func
msg = 'Call to deprecated function `%s`.' % func.__name__
msg = 'Call to deprecated function ``%s``.' % func.__name__
msg += alt_msg
@functools.wraps(func)
@@ -48,6 +48,6 @@ class deprecated(object):
if wrapped.__doc__ is None:
wrapped.__doc__ = doc
else:
wrapped.__doc__ = doc + '\n\n' + wrapped.__doc__
wrapped.__doc__ = doc + '\n\n ' + wrapped.__doc__
return wrapped