mirror of https://github.com/python/cpython.git
mkalias() now also works for folders. Fixes bug #515830.
This commit is contained in:
parent
b5255114d1
commit
a2168eceb0
|
@ -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, '')
|
||||
|
|
Loading…
Reference in New Issue