mirror of
https://github.com/erkin/ponysay.git
synced 2024-11-22 20:38:00 +01:00
I think readlink only follows one level, this should get the canonical path (absolute and to the last level)
This commit is contained in:
parent
f76bef8fac
commit
5744c13146
1 changed files with 1 additions and 1 deletions
2
ponysay
2
ponysay
|
@ -257,7 +257,7 @@ class Ponysay():
|
||||||
if (len(pony) > 5) and (pony[-5:] == '.pony'):
|
if (len(pony) > 5) and (pony[-5:] == '.pony'):
|
||||||
ponies.append(pony[:-5])
|
ponies.append(pony[:-5])
|
||||||
ponies.sort()
|
ponies.sort()
|
||||||
pairs = [(pony, os.readlink(ponydir + pony + '.pony') if os.path.islink(ponydir + pony + '.pony') else '') for pony in ponies]
|
pairs = [(pony, os.path.realpath(ponydir + pony + '.pony') if os.path.islink(ponydir + pony + '.pony') else '') for pony in ponies]
|
||||||
|
|
||||||
ponymap = {}
|
ponymap = {}
|
||||||
for pair in pairs:
|
for pair in pairs:
|
||||||
|
|
Loading…
Reference in a new issue