diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2002-03-12 15:05:11 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2002-03-12 15:05:11 (GMT) |
commit | 6ae46a7cbf4f0feb63e6cece78f6a935cd18ed3b (patch) | |
tree | f0803ec22ceb7408a4c7b21a71ccced97f33664f /Mac/Lib | |
parent | 8a944345cebc4b5cbb651a4bcd5af08460d485fa (diff) | |
download | cpython-6ae46a7cbf4f0feb63e6cece78f6a935cd18ed3b.zip cpython-6ae46a7cbf4f0feb63e6cece78f6a935cd18ed3b.tar.gz cpython-6ae46a7cbf4f0feb63e6cece78f6a935cd18ed3b.tar.bz2 |
Backport of 1.14:
mkalias() now also works for folders. Fixes bug #515830.
Diffstat (limited to 'Mac/Lib')
-rw-r--r-- | Mac/Lib/macostools.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Mac/Lib/macostools.py b/Mac/Lib/macostools.py index 72f2032..43ab74f 100644 --- a/Mac/Lib/macostools.py +++ b/Mac/Lib/macostools.py @@ -34,9 +34,13 @@ def mkalias(src, dst, relative=None): alias = srcfss.NewAlias(relativefss) else: alias = srcfss.NewAlias() - srcfinfo = srcfss.GetFInfo() - - Res.FSpCreateResFile(dstfss, srcfinfo.Creator, srcfinfo.Type, -1) + + if os.path.isdir(src): + cr, tp = 'MACS', 'fdrp' + else: + cr, tp = srcfss.GetCreatorType() + + Res.FSpCreateResFile(dstfss, cr, tp, -1) h = Res.FSpOpenResFile(dstfss, 3) resource = Res.Resource(alias.data) resource.AddResource('alis', 0, '') |