From a6651e8a71d5b6e59abbbd5b168dd857bb05ba66 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Tue, 17 Sep 2013 21:46:22 +1000 Subject: [PATCH] Expose C extension variants of function wrapper base and bound wrapper classes to allow customisation in pure Python code. --- src/_wrappers.c | 10 ++++++++++ src/wrappers.py | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/_wrappers.c b/src/_wrappers.c index 2deb6d0..1661c42 100644 --- a/src/_wrappers.c +++ b/src/_wrappers.c @@ -2044,6 +2044,16 @@ moduleinit(void) PyModule_AddObject(module, "FunctionWrapper", (PyObject *)&WraptFunctionWrapper_Type); + Py_INCREF(&WraptFunctionWrapperBase_Type); + PyModule_AddObject(module, "_FunctionWrapperBase", + (PyObject *)&WraptFunctionWrapperBase_Type); + Py_INCREF(&WraptBoundFunctionWrapper_Type); + PyModule_AddObject(module, "_BoundFunctionWrapper", + (PyObject *)&WraptBoundFunctionWrapper_Type); + Py_INCREF(&WraptBoundMethodWrapper_Type); + PyModule_AddObject(module, "_BoundMethodWrapper", + (PyObject *)&WraptBoundMethodWrapper_Type); + return module; } diff --git a/src/wrappers.py b/src/wrappers.py index 2ead039..475c94c 100644 --- a/src/wrappers.py +++ b/src/wrappers.py @@ -509,7 +509,8 @@ class FunctionWrapper(_FunctionWrapperBase): adapter, bound_type) try: - from ._wrappers import ObjectProxy, FunctionWrapper + from ._wrappers import (ObjectProxy, FunctionWrapper, + _FunctionWrapperBase, _BoundFunctionWrapper, _BoundMethodWrapper) except ImportError: pass