From c1a95707e86336f4c062ac67e7255f0526524b28 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Mon, 6 Mar 2006 05:59:54 +0000 Subject: [PATCH] fix SWIG_Python_TypeQuery for C/Ansi, ie, the old variable declared after code issue git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8967 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/python/pyrun.swg | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SWIG/Lib/python/pyrun.swg b/SWIG/Lib/python/pyrun.swg index 91c7261cb..26d181a5b 100644 --- a/SWIG/Lib/python/pyrun.swg +++ b/SWIG/Lib/python/pyrun.swg @@ -1320,11 +1320,16 @@ SWIG_Python_SetModule(swig_module_info *swig_module) { } /* The python cached type query */ +SWIGRUNTIME PyObject * +SWIG_Python_TypeCache() { + static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); + return cache; +} SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type) { - static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); + PyObject *cache = SWIG_Python_TypeCache(); PyObject *key = PyString_FromString(type); PyObject *obj = PyDict_GetItem(cache, key); swig_type_info *descriptor;