diff options
author | Guido van Rossum <guido@python.org> | 2007-02-11 18:53:00 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-02-11 18:53:00 (GMT) |
commit | cd70eee24469b91d85bd66e31c44aad76d22f93a (patch) | |
tree | b1c359836450f9b23238939b6fb4d2c53580fd75 | |
parent | 091153d43bfe6b53c975c11de2266ee719e02824 (diff) | |
download | cpython-cd70eee24469b91d85bd66e31c44aad76d22f93a.zip cpython-cd70eee24469b91d85bd66e31c44aad76d22f93a.tar.gz cpython-cd70eee24469b91d85bd66e31c44aad76d22f93a.tar.bz2 |
Another fix. Partly reverted the tweaks done by the previous fix.
-rw-r--r-- | Lib/test/test_builtin.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index b6ac990..e22e73a 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -290,8 +290,8 @@ class BuiltinTest(unittest.TestCase): if key == 'a': return 12 raise KeyError - def __iter__(self): - return iter('xyz') + def keys(self): + return list('xyz') m = M() g = globals() @@ -313,8 +313,8 @@ class BuiltinTest(unittest.TestCase): if key == 'a': return 12 return dict.__getitem__(self, key) - def __iter__(self): - return iter('xyz') + def keys(self): + return list('xyz') d = D() self.assertEqual(eval('a', g, d), 12) @@ -346,8 +346,8 @@ class BuiltinTest(unittest.TestCase): class C: def __getitem__(self, item): raise KeyError(item) - def __iter__(self): - return 'a' # XXX Not quite faithful to the SF bug... + def keys(self): + return 1 # used to be 'a' but that's no longer an error self.assertRaises(TypeError, eval, 'dir()', globals(), C()) # Done outside of the method test_z to get the correct scope |