[Python-checkins] r65453 - python/trunk/Lib/filecmp.py
brett.cannon
python-checkins at python.org
Mon Aug 4 01:46:47 CEST 2008
Author: brett.cannon
Date: Mon Aug 4 01:46:46 2008
New Revision: 65453
Log:
Move filecmp from using dict.has_key() to dict.__contains__() to silence
warnings triggered under -3.
Modified:
python/trunk/Lib/filecmp.py
Modified: python/trunk/Lib/filecmp.py
==============================================================================
--- python/trunk/Lib/filecmp.py (original)
+++ python/trunk/Lib/filecmp.py Mon Aug 4 01:46:46 2008
@@ -132,9 +132,9 @@
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 = []
More information about the Python-checkins
mailing list