Add error-checking to namedtuple's _replace() method.
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index c17b76d..dd9982a 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -55,6 +55,13 @@
self.assertEqual(p._replace(x=1), (1, 22)) # test _replace method
self.assertEqual(p._asdict(), dict(x=11, y=22)) # test _asdict method
+ try:
+ p._replace(x=1, error=2)
+ except ValueError:
+ pass
+ else:
+ self._fail('Did not detect an incorrect fieldname')
+
# verify that field string can have commas
Point = namedtuple('Point', 'x, y')
p = Point(x=11, y=22)