pyinstaller/pyinstaller — pull request #81 by overlordtm (2013-09-26 07:13:00+00:00)
Title: Fix C module imports

When using 64bit python, there are multiple possible C extensions.

```python
imp.get_suffixes()
[('.x86_64-linux-gnu.so', 'rb', 3),
('.so', 'rb', 3),
('module.so', 'rb', 3),
('.py', 'U', 1),
('.pyc', 'rb', 2)]
````

Current develop branch of pyinstaller loops through possible extensions and breaks on first match. But this is not always the right extension, so I moved extension search code into find_module method, so it tests all possible extensions for module until it finds the match.

Minimal example test.py:
```python
import glib
print "Hello world"
```
Output:
```
az@ares ~/tmp/py-glib> ./dist/test/test
Traceback (most recent call last):
File "", line 1, in
File "/home/az/workspace.koofr/pyinstaller/PyInstaller/loader/pyi_importers.py", line 270, in load_module
exec(bytecode, module.__dict__)
File "/home/az/tmp/py-glib/build/test/out00-PYZ.pyz/glib", line 22, in
ImportError: No module named _glib
```

Output of fixed version:
```
az@ares ~/tmp/py-glib> ./dist/test/test
Hello world
```

I have encountered same error also with gobject and PySide.

Python I am using (on Ubuntu 13.04):
```
az@ares ~/tmp/py-glib> python
Python 2.7.4 (default, Apr 19 2013, 18:28:01)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
```