8000 Merge pull request #8803 from gabriel-munteanu/pypy-compatibility · matplotlib/matplotlib@6c51037 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6c51037

Browse files
authored
Merge pull request #8803 from gabriel-munteanu/pypy-compatibility
Catch exception for PyPy
2 parents 3ecd965 + 13cacb1 commit 6c51037

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/cbook/deprecation.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,10 @@ def deprecate(obj, message=message, name=name, alternative=alternative,
174174
def finalize(wrapper, new_doc):
175175
try:
176176
obj.__doc__ = new_doc
177-
except AttributeError:
178-
pass # cls.__doc__ is not writeable on Py2.
177+
except (AttributeError, TypeError):
178+
# cls.__doc__ is not writeable on Py2.
179+
# TypeError occurs on PyPy
180+
pass
179181
obj.__init__ = wrapper
180182
return obj
181183
else:

0 commit comments

Comments
 (0)
0