Author: Amaury Forgeot d'Arc <[email protected]>
Branch: merge-2.7.2
Changeset: r51666:c84666d936d2
Date: 2012-01-22 21:10 +0100
http://bitbucket.org/pypy/pypy/changeset/c84666d936d2/
Log: Allow both str.__add__ to raise TypeError or return NotImplemented.
IMO the point of the test is to check that str.__add__ does not
crash or use str() instead.
diff --git a/lib-python/modified-2.7/test/test_descr.py
b/lib-python/modified-2.7/test/test_descr.py
--- a/lib-python/modified-2.7/test/test_descr.py
+++ b/lib-python/modified-2.7/test/test_descr.py
@@ -4592,8 +4592,12 @@
str.split(fake_str)
# call a slot wrapper descriptor
- with self.assertRaises(TypeError):
- str.__add__(fake_str, "abc")
+ try:
+ r = str.__add__(fake_str, "abc")
+ except TypeError:
+ pass
+ else:
+ self.assertEqual(r, NotImplemented)
class DictProxyTests(unittest.TestCase):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit