From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 9E07E1381FB for ; Fri, 28 Dec 2012 22:31:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8B81B21C014; Fri, 28 Dec 2012 22:31:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0C44E21C014 for ; Fri, 28 Dec 2012 22:31:23 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0797F33DA33 for ; Fri, 28 Dec 2012 22:31:23 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 8BF2EE543D for ; Fri, 28 Dec 2012 22:31:21 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1356733870.9e37cca4f54260bd8c45a3041fcee00938c71649.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/util/_ctypes.py X-VCS-Directories: pym/portage/util/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 9e37cca4f54260bd8c45a3041fcee00938c71649 X-VCS-Branch: master Date: Fri, 28 Dec 2012 22:31:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: d9398d7e-e751-4bbf-aa5d-3fbabcc061d4 X-Archives-Hash: afae9d8a78ed1f896e7a4e01ad6d6b0e commit: 9e37cca4f54260bd8c45a3041fcee00938c71649 Author: Zac Medico gentoo org> AuthorDate: Fri Dec 28 22:31:10 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri Dec 28 22:31:10 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9e37cca4 _ctypes: don't cache library, bug #448858 --- pym/portage/util/_ctypes.py | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pym/portage/util/_ctypes.py b/pym/portage/util/_ctypes.py index 4e5aa2a..f419b19 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