Files
pyinstaller/hooks/hook-distutils.py
giovannibajo c4627b96da Ticket #168: fix hook distutils under Windows
git-svn-id: http://svn.pyinstaller.org/trunk@804 8dd32b29-ccff-0310-8a9a-9233e24343b1
2010-03-18 10:08:43 +00:00

13 lines
468 B
Python

# Contributed by jkp@kirkconsulting.co.uk
# This hook checks for the distutils hacks present when using the
# virtualenv package.
def hook(mod):
import distutils
if hasattr(distutils, "distutils_path"):
import os
import marshal
mod_path = os.path.join(distutils.distutils_path, "__init__.pyc")
parsed_code = marshal.loads(open(mod_path, "rb").read()[8:])
mod.__init__('distutils', mod_path, parsed_code)
return mod