Files
pyinstaller/buildtests/hooks1/hook-pkg1.py
T
giovannibajo b98a53df92 Imported Python Installer 5b5
git-svn-id: http://svn.pyinstaller.org/trunk@2 8dd32b29-ccff-0310-8a9a-9233e24343b1
2005-09-02 17:15:02 +00:00

12 lines
424 B
Python

attrs = [('notamodule','')]
def hook(mod):
import os, sys, marshal
other = os.path.join(mod.__path__[0], '../pkg2/__init__.pyc')
if os.path.exists(other):
co = marshal.loads(open(other,'rb').read()[8:])
else:
co = compile(open(other[:-1],'r').read()+'\n', other, 'exec')
mod.__init__(mod.__name__, other, co)
mod.__path__.append(os.path.join(mod.__path__[0], 'extra'))
return mod