]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
- Use imp to find appletrawmain.py in stead of hand-crafting the path
authorJack Jansen <jack.jansen@cwi.nl>
Mon, 11 Nov 2002 00:06:14 +0000 (00:06 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Mon, 11 Nov 2002 00:06:14 +0000 (00:06 +0000)
  to it.
- Allow for symlinks in the applet template.

Mac/Lib/buildtools.py

index 163f19a0cf0520795fdaff362c8b9e3fc18f716a..68a6614535f35f8e6fea8a8089547cbdae4ef8be 100644 (file)
@@ -389,8 +389,8 @@ def process_common_macho(template, progress, code, rsrcname, destname, is_update
                        if progress:
                                progress.label('Creating __rawmain__.pyc')
                                progress.inc(0)
-                       rawsourcefile = os.path.join(sys.prefix, 'Mac', 'Lib', 'appletrawmain.py')
-                       rawsource = open(rawsourcefile, 'rU').read()
+                       rawsourcefp, rawsourcefile, d2 = imp.find_module('appletrawmain')
+                       rawsource = rawsourcefp.read()
                        rawcode = compile(rawsource, rawsourcefile, 'exec')
                        writepycfile(rawcode, outputfilename)
                        
@@ -488,6 +488,9 @@ def copyapptree(srctree, dsttree, exceptlist=[], progress=None):
                dstpath = os.path.join(dsttree, this)
                if os.path.isdir(srcpath):
                        os.mkdir(dstpath)
+               elif os.path.islink(srcpath):
+                       endpoint = os.readlink(srcpath)
+                       os.symlink(endpoint, dstpath)
                else:
                        if progress:
                                progress.label('Copy '+this)