mercurial/posix.py
branchstable
changeset 15353 ab600a25dfc0
parent 15056 8413916df816
child 15488 6eff984d8e76
equal deleted inserted replaced
15352:b74f74b482d8 15353:ab600a25dfc0
   197 
   197 
   198         try:
   198         try:
   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
   205 
   213 
   206 def shellquote(s):
   214 def shellquote(s):