From 6ae46a7cbf4f0feb63e6cece78f6a935cd18ed3b Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Tue, 12 Mar 2002 15:05:11 +0000 Subject: [PATCH] Backport of 1.14: mkalias() now also works for folders. Fixes bug #515830. --- Mac/Lib/macostools.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Mac/Lib/macostools.py b/Mac/Lib/macostools.py index 72f2032adf98..43ab74fb7760 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, '') -- 2.47.3