Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit be6af2f

Browse files
committed
obscure way of getting to the function, but works in 2.5
see http://bugs.python.org/issue5982 for the source
1 parent ea16278 commit be6af2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/testing/decorators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test(self):
6868
def cleanup(func):
6969
name = func.__name__
7070
func = staticmethod(func)
71-
func.__func__.__name__ = '_private'
71+
func.__get__(1).__name__ = '_private'
7272
new_class = new.classobj(
7373
name,
7474
(CleanupTest,),
@@ -166,7 +166,7 @@ def compare_images_decorator(func):
166166
# well, outside of the context of our image comparison test
167167
# generator.
168168
func = staticmethod(func)
169-
func.__func__.__name__ = '_private'
169+
func.__get__(1).__name__ = '_private'
170170
new_class = new.classobj(
171171
name,
172172
(ImageComparisonTest,),

0 commit comments

Comments
 (0)