##// END OF EJS Templates
posix: workaround for os.path.realpath bug in Python 2.4.1 and before...
Thomas Arendsen Hein -
r15353:ab600a25 stable
parent child Browse files
Show More
@@ -199,6 +199,14 b" if sys.platform == 'darwin':"
199 return fcntl.fcntl(fd, F_GETPATH, '\0' * 1024).rstrip('\0')
199 return fcntl.fcntl(fd, F_GETPATH, '\0' * 1024).rstrip('\0')
200 finally:
200 finally:
201 os.close(fd)
201 os.close(fd)
202 elif sys.version_info < (2, 4, 2, 'final'):
203 # Workaround for http://bugs.python.org/issue1213894 (os.path.realpath
204 # didn't resolve symlinks that were the first component of the path.)
205 def realpath(path):
206 if os.path.isabs(path):
207 return os.path.realpath(path)
208 else:
209 return os.path.realpath('./' + path)
202 else:
210 else:
203 # Fallback to the likely inadequate Python builtin function.
211 # Fallback to the likely inadequate Python builtin function.
204 realpath = os.path.realpath
212 realpath = os.path.realpath
General Comments 0
You need to be logged in to leave comments. Login now