From cd73020f2445b3b13a6ae33e754191600252e477 Mon Sep 17 00:00:00 2001 From: fuzzyray Date: Wed, 9 Jul 2008 15:51:03 +0000 Subject: [PATCH] Fix gentoolkit to work without thread support in python. (Bug 223255) svn path=/; revision=491 --- trunk/ChangeLog | 4 ++++ trunk/src/gentoolkit/__init__.py | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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 -- 2.26.2