[gobject-introspection/wip/nonrecursive-make: 2/5] libtoolimporter: Don't assume we have a multi-component import



commit f1e25509e568d69e8442d4806f64b2b5e9cd55b6
Author: Colin Walters <walters verbum org>
Date:   Tue Nov 9 09:15:13 2010 -0500

    libtoolimporter: Don't assume we have a multi-component import
    
    os.path.join barfs if we're passing it 0 arguments, as would happen
    when doing "import foo".

 giscanner/libtoolimporter.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/giscanner/libtoolimporter.py b/giscanner/libtoolimporter.py
index 84c62f9..20bd005 100644
--- a/giscanner/libtoolimporter.py
+++ b/giscanner/libtoolimporter.py
@@ -41,10 +41,14 @@ class LibtoolImporter(object):
         # should be looked for. See if we can find a ".libs/module.la" relative
         # to those directories and failing that look for file
         # "some/package/.libs/module.la" relative to sys.path
-        module = os.path.join(*modparts)
+        if len(modparts) > 0:
+            modprefix = os.path.join(*modparts)
+            modprefix = os.path.join(modprefix, '.libs')
+        else:
+            modprefix = '.libs'
 
         for path in sys.path:
-            full = os.path.join(path, module, '.libs', filename)
+            full = os.path.join(path, modprefix, filename)
             if os.path.exists(full):
                 return cls(name, full)
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]