posix: remove is-comparison between integers stable
authorDan Villiom Podlaski Christiansen <danchr@gmail.com>
Tue, 16 Nov 2010 21:35:58 +0100
branchstable
changeset 13007 e98bf6948092
parent 13006 ea68947ad0ce
child 13008 ac627ab0b3a5
child 13013 92b0d669637f
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>
mercurial/posix.py
--- a/mercurial/posix.py	Tue Nov 16 21:35:58 2010 +0100
+++ b/mercurial/posix.py	Tue Nov 16 21:35:58 2010 +0100
@@ -144,7 +144,7 @@
         try:
             fd = os.open(path, O_SYMLINK)
         except OSError, err:
-            if err.errno is errno.ENOENT:
+            if err.errno == errno.ENOENT:
                 return path
             raise