comparison mercurial/posix.py @ 13007:e98bf6948092 stable

posix: remove is-comparison between integers Comparing integers by identity relies on a CPython implementation detail of caching integers between -5 and 256.[1] [1] <http://docs.python.org/c-api/int.html#PyInt_FromLong>
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Tue, 16 Nov 2010 21:35:58 +0100
parents c52c629ce19e
children 6052bbc7aabd
comparison
equal deleted inserted replaced
13006:ea68947ad0ce 13007:e98bf6948092
142 O_SYMLINK = 0x200000 142 O_SYMLINK = 0x200000
143 143
144 try: 144 try:
145 fd = os.open(path, O_SYMLINK) 145 fd = os.open(path, O_SYMLINK)
146 except OSError, err: 146 except OSError, err:
147 if err.errno is errno.ENOENT: 147 if err.errno == errno.ENOENT:
148 return path 148 return path
149 raise 149 raise
150 150
151 try: 151 try:
152 return fcntl.fcntl(fd, F_GETPATH, '\0' * 1024).rstrip('\0') 152 return fcntl.fcntl(fd, F_GETPATH, '\0' * 1024).rstrip('\0')