aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-12-28 14:31:10 -0800
committerZac Medico <zmedico@gentoo.org>2012-12-28 14:31:10 -0800
commit9e37cca4f54260bd8c45a3041fcee00938c71649 (patch)
tree6ab8d0bc1abc36156455b5a9b3e0255f247acff5 /pym/portage/util/_ctypes.py
parentman pages: refer to /etc/portage/make.conf (diff)
downloadportage-9e37cca4f54260bd8c45a3041fcee00938c71649.tar.gz
portage-9e37cca4f54260bd8c45a3041fcee00938c71649.tar.bz2
portage-9e37cca4f54260bd8c45a3041fcee00938c71649.zip
_ctypes: don't cache library, bug #448858
Diffstat (limited to 'pym/portage/util/_ctypes.py')
-rw-r--r--pym/portage/util/_ctypes.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/pym/portage/util/_ctypes.py b/pym/portage/util/_ctypes.py
index 4e5aa2a6b..f419b1926 100644
--- a/pym/portage/util/_ctypes.py
+++ b/pym/portage/util/_ctypes.py
@@ -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