]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Move filecmp from using dict.has_key() to dict.__contains__() to silence
authorBrett Cannon <bcannon@gmail.com>
Sun, 3 Aug 2008 23:46:46 +0000 (23:46 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sun, 3 Aug 2008 23:46:46 +0000 (23:46 +0000)
warnings triggered under -3.

Lib/filecmp.py

index 35cedef6b8ab10c2ded1ac48ae2d9f80cc9abfb8..9885765031f35ddf52ad00f23e013250b2405cda 100644 (file)
@@ -132,9 +132,9 @@ class dircmp:
     def phase1(self): # Compute common names
         a = dict(izip(imap(os.path.normcase, self.left_list), self.left_list))
         b = dict(izip(imap(os.path.normcase, self.right_list), self.right_list))
-        self.common = map(a.__getitem__, ifilter(b.has_key, a))
-        self.left_only = map(a.__getitem__, ifilterfalse(b.has_key, a))
-        self.right_only = map(b.__getitem__, ifilterfalse(a.has_key, b))
+        self.common = map(a.__getitem__, ifilter(b.__contains__, a))
+        self.left_only = map(a.__getitem__, ifilterfalse(b.__contains__, a))
+        self.right_only = map(b.__getitem__, ifilterfalse(a.__contains__, b))
 
     def phase2(self): # Distinguish files, directories, funnies
         self.common_dirs = []