From cd73020f2445b3b13a6ae33e754191600252e477 Mon Sep 17 00:00:00 2001 From: fuzzyray Date: Wed, 9 Jul 2008 15:51:03 +0000 Subject: Fix gentoolkit to work without thread support in python. (Bug 223255) svn path=/; revision=491 --- trunk/src/gentoolkit/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'trunk/src') 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 -- cgit v1.2.3