summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJust van Rossum <just@letterror.com>2002-03-10 19:28:02 (GMT)
committerJust van Rossum <just@letterror.com>2002-03-10 19:28:02 (GMT)
commita2168eceb0277f767877a0845537f6564f0410a0 (patch)
tree40c83ddbfbe6c0fb1ff4beed1438821235795eb9 /Mac
parentb5255114d1221f3fec027005a16dc61812eacf4b (diff)
downloadcpython-a2168eceb0277f767877a0845537f6564f0410a0.zip
cpython-a2168eceb0277f767877a0845537f6564f0410a0.tar.gz
cpython-a2168eceb0277f767877a0845537f6564f0410a0.tar.bz2
mkalias() now also works for folders. Fixes bug #515830.
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Lib/macostools.py10
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, '')