diff options
author | Colin Walters <walters@verbum.org> | 2010-11-09 09:15:13 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2010-11-09 11:52:29 -0500 |
commit | f1e25509e568d69e8442d4806f64b2b5e9cd55b6 (patch) | |
tree | 0e60a1fd150523be37364a4b017ed490e55b4c87 /giscanner | |
parent | 8f5d725524acf1cd1631e36de4de52efbee04ffa (diff) | |
download | gobject-introspection-f1e25509e568d69e8442d4806f64b2b5e9cd55b6.tar.gz |
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".
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/libtoolimporter.py | 8 |
1 files 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) |