From f1e25509e568d69e8442d4806f64b2b5e9cd55b6 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 9 Nov 2010 09:15:13 -0500 Subject: 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 file changed, 6 insertions(+), 2 deletions(-) diff --git a/giscanner/libtoolimporter.py b/giscanner/libtoolimporter.py index 84c62f93..20bd0053 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) -- cgit v1.2.1