diff options
| author | Brett Cannon <bcannon@gmail.com> | 2008-08-03 23:46:46 (GMT) |
|---|---|---|
| committer | Brett Cannon <bcannon@gmail.com> | 2008-08-03 23:46:46 (GMT) |
| commit | c66b03a4c1e60d6ce896e1e5458f5dbf7140d2a8 (patch) | |
| tree | 6dee20495a4db7baa2c997e4c5c2ec437ced6cb5 | |
| parent | 81614988176cc79b74c2dc9dbc38cd56856a08e7 (diff) | |
| download | cpython-c66b03a4c1e60d6ce896e1e5458f5dbf7140d2a8.zip cpython-c66b03a4c1e60d6ce896e1e5458f5dbf7140d2a8.tar.gz cpython-c66b03a4c1e60d6ce896e1e5458f5dbf7140d2a8.tar.bz2 | |
Move filecmp from using dict.has_key() to dict.__contains__() to silence
warnings triggered under -3.
| -rw-r--r-- | Lib/filecmp.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/filecmp.py b/Lib/filecmp.py index 35cedef..9885765 100644 --- a/Lib/filecmp.py +++ b/Lib/filecmp.py @@ -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 = [] |
