Return an empty string rather than None when calling repr()

Repr() should return "a string containing a printable representation of
an object," which is a convention Sphinx 1.2 relies on when building
the docs.

Fixes bug 1163369

Change-Id: Ieefd69c5b4b521500679df7745f60cb3a4d2f77c
(cherry picked from commit 29cb3251af)
This commit is contained in:
Julie Pichon 2013-04-02 22:08:33 +01:00
parent 14ac6a90f4
commit 2a939ceb2a
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ class memoized(object):
def __repr__(self):
'''Return the function's docstring.'''
return self.func.__doc__
return self.func.__doc__ or ''
def __get__(self, obj, objtype):
'''Support instance methods.'''