Fix gentoolkit to work without thread support in python. (Bug 223255)
authorfuzzyray <fuzzyray@gentoo.org>
Wed, 9 Jul 2008 15:51:03 +0000 (15:51 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Wed, 9 Jul 2008 15:51:03 +0000 (15:51 -0000)
svn path=/; revision=491

trunk/ChangeLog
trunk/src/gentoolkit/__init__.py

index 41844d958de5ccf9d11b516ae4c724afd94b0d64..0faeb80f5a76e8fea7c716b6123401aacb7faeef 100644 (file)
@@ -1,3 +1,7 @@
+2008-07-09: Paul Varner <fuzzyray@gentoo.org>
+       * gentoolkit: Fix gentoolkit to work without thread support in 
+       python. (Bug 223255)
+
 2008-06-16: Marius Mauch <genone@gentoo.org>
        * euse: Add support for multi-parent profiles, account for missing 
        final newline in make.conf
index 668da0dd6c833a25eb9b544c2a081ffda275c3bf..28b56bea5706e662ce30368404a187ef366bca06 100644 (file)
@@ -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