_ctypes: don't cache library, bug #448858
authorZac Medico <zmedico@gentoo.org>
Fri, 28 Dec 2012 22:31:10 +0000 (14:31 -0800)
committerZac Medico <zmedico@gentoo.org>
Fri, 28 Dec 2012 22:31:10 +0000 (14:31 -0800)
pym/portage/util/_ctypes.py

index 4e5aa2a6b3ad4414b10c374325dbd2c7ed5663e5..f419b1926544cf4e3daef9a55008e1f19dde06c8 100644 (file)
@@ -31,17 +31,15 @@ def find_library(name):
                return None
        return filename
 
-_library_handles = {}
-
 def LoadLibrary(name):
        """
        Calls ctypes.cdll.LoadLibrary(name) if the ctypes module is available,
-       and otherwise returns None. Results are cached for future invocations.
+       and otherwise returns None. Results are not cached, since that can
+       cause problems when libraries are updated (see bug #448858).
        """
-       handle = _library_handles.get(name)
+       handle = None
 
-       if handle is None and ctypes is not None:
+       if ctypes is not None:
                handle = ctypes.cdll.LoadLibrary(name)
-               _library_handles[name] = handle
 
        return handle