Skip to content

Commit

Permalink
Fix: getting __file__ attribute for modules pythoncom and pywintypes.
Browse files Browse the repository at this point in the history
  • Loading branch information
matysek committed Jun 26, 2015
1 parent 6d8b56d commit 6a916fc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion PyInstaller/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,7 @@ def assemble(self):
os.makedirs(self.name)
toc = add_suffix_to_extensions(self.toc)
for inm, fnm, typ in toc:
if not os.path.isfile(fnm) and is_path_to_egg(fnm):
if not os.path.exists(fnm) or not os.path.isfile(fnm) and is_path_to_egg(fnm):
# file is contained within python egg, it is added with the egg
continue
if os.pardir in os.path.normpath(inm) or os.path.isabs(inm):
Expand Down
18 changes: 13 additions & 5 deletions PyInstaller/hooks/hook-pythoncom.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@
"""

import os.path
from PyInstaller.utils.hooks import hookutils
from PyInstaller.utils.hooks.hookutils import get_module_file_attribute

# Absolute path of the corresponding DLL. On importation, this module
# dynamically imports and replaces itself in memory with this DLL.
_dll_file = hookutils.get_pywin32_module_file_attribute('pythoncom')
binaries = [(os.path.basename(_dll_file), _dll_file)]
_pth = get_module_file_attribute('pythoncom')

# Binaries that should be included with the module 'pythoncom'.
# List mod.pyinstaller_binaries gets extended.
binaries = [
(
# Relative path in the ./dist/app_name/ directory.
os.path.basename(_pth),
# Absolute path on hard disk.
_pth,
)
]
8 changes: 3 additions & 5 deletions PyInstaller/hooks/hook-pywintypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
"""

import os.path
from PyInstaller.utils.hooks import hookutils
from PyInstaller.utils.hooks.hookutils import get_module_file_attribute

# Absolute path of the corresponding DLL. On importation, this module
# dynamically imports and replaces itself in memory with this DLL.
_dll_file = hookutils.get_pywin32_module_file_attribute('pywintypes')
binaries = [(os.path.basename(_dll_file), _dll_file)]
_pth = get_module_file_attribute('pywintypes')
binaries = [(os.path.basename(_pth), _pth)]

0 comments on commit 6a916fc

Please sign in to comment.