os.path.join barfs if we're passing it 0 arguments, as would happen
when doing "import foo".
# 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)