8000 Remove 2.6 related workaround in cbook · matplotlib/matplotlib@aad5ad7 · GitHub
[go: up one dir, main page]

Skip to content

Commit aad5ad7

Browse files
committed
Remove 2.6 related workaround in cbook
1 parent f39b388 commit aad5ad7

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

lib/matplotlib/cbook.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -191,20 +191,7 @@ def deprecate(func, message=message, name=name, alternative=alternative,
191191
import textwrap
192192

193193
if isinstance(func, classmethod):
194-
try:
195-
func = func.__func__
196-
except AttributeError:
197-
# classmethods in Python2.6 and below lack the __func__
198-
# attribute so we need to hack around to get it
199-
method = func.__get__(None, object)
200-
if hasattr(method, '__func__'):
201-
func = method.__func__
202-
elif hasattr(method, 'im_func'):
203-
func = method.im_func
204-
else:
205-
# Nothing we can do really... just return the original
206-
# classmethod
207-
return func
194+
func = func.__func__
208195
is_classmethod = True
209196
else:
210197
is_classmethod = False

0 commit comments

Comments
 (0)
0