From: fuzzyray Date: Wed, 9 Jul 2008 15:51:03 +0000 (-0000) Subject: Fix gentoolkit to work without thread support in python. (Bug 223255) X-Git-Tag: gentoolkit-0.2.4.3~22 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cd73020f2445b3b13a6ae33e754191600252e477;p=gentoolkit.git Fix gentoolkit to work without thread support in python. (Bug 223255) svn path=/; revision=491 --- diff --git a/trunk/ChangeLog b/trunk/ChangeLog index 41844d9..0faeb80 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,7 @@ +2008-07-09: Paul Varner + * gentoolkit: Fix gentoolkit to work without thread support in + python. (Bug 223255) + 2008-06-16: Marius Mauch * euse: Add support for multi-parent profiles, account for missing final newline in make.conf diff --git a/trunk/src/gentoolkit/__init__.py b/trunk/src/gentoolkit/__init__.py index 668da0d..28b56be 100644 --- a/trunk/src/gentoolkit/__init__.py +++ b/trunk/src/gentoolkit/__init__.py @@ -25,7 +25,16 @@ except ImportError: sys.path.insert(0, "/usr/lib/portage/pym") import portage import re -from threading import Lock +try: + from threading import Lock +except ImportError: + # If we don't have thread support, we don't need to worry about + # locking the global settings object. So we define a "null" Lock. + class Lock: + def acquire(self): + pass + def release(self): + pass try: import portage.exception as portage_exception