tests/test-extensions-wrapfunction.py
changeset 34143 82bd4c5a81e5
parent 34032 47e52f079a57
child 37982 ac865f020b99
--- a/tests/test-extensions-wrapfunction.py	Tue Sep 12 09:13:02 2017 -0700
+++ b/tests/test-extensions-wrapfunction.py	Sun Sep 10 23:37:14 2017 +0900
@@ -54,3 +54,11 @@
         print('context manager', dummy.getstack())
     print('context manager', dummy.getstack())
 print('context manager', dummy.getstack())
+
+# Wrap callable object which has no __name__
+class callableobj(object):
+    def __call__(self):
+        return ['orig']
+dummy.cobj = callableobj()
+extensions.wrapfunction(dummy, 'cobj', wrappers[0])
+print('wrap callable object', dummy.cobj())