Skip to content

Commit 56f92e4

Browse files
Catch exception for PyPy
1 parent 03dd8e4 commit 56f92e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/cbook/deprecation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ 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+
pass # cls.__doc__ is not writeable on Py2. TypeError occurs on PyPy
179179
obj.__init__ = wrapper
180180
return obj
181181
else:

0 commit comments

Comments
 (0)