Skip to content

Commit

Permalink
Issue #1580: Fix collect_submodules() to split whole suffix like .cpy…
Browse files Browse the repository at this point in the history
…thon-34m.so while evaluating filenames.
  • Loading branch information
matysek committed Oct 13, 2015
1 parent 9569287 commit 90d1cb2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion PyInstaller/utils/hooks/__init__.py
Expand Up @@ -17,7 +17,7 @@
import sys

from ... import compat
from ...compat import is_py2, is_win, is_py3, is_darwin
from ...compat import is_py2, is_win, is_py3, is_darwin, EXTENSION_SUFFIXES
from ...config import CONF
from ...utils import misc
from ... import HOMEPATH
Expand Down Expand Up @@ -592,7 +592,13 @@ def remove_suffix(string, suffix):
def remove_file_extension(filename):
"""
This function returns filename without its extension.
For Python C modules it removes even whole '.cpython-34m.so' etc.
"""
for suff in EXTENSION_SUFFIXES:
if filename.endswith(suff):
return filename[0:filename.rfind(suff)]
# Fallback to ordinary 'splitext'.
return os.path.splitext(filename)[0]


Expand Down

0 comments on commit 90d1cb2

Please sign in to comment.