mirror of
https://github.com/kennethreitz-archive/pyinstaller.git
synced 2026-06-05 23:50:17 +00:00
c4627b96da
git-svn-id: http://svn.pyinstaller.org/trunk@804 8dd32b29-ccff-0310-8a9a-9233e24343b1
13 lines
468 B
Python
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
|