From 0bb0299ad8c538eb6d24644b8305c45c110d6c4f Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 18 May 2008 10:39:26 +0000 Subject: [PATCH] Take namedtuple item names only from ascii_letters (this blew up on OSX), and make sure there are no duplicate names. --- Lib/test/test_collections.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index 15f0bf73ed..a770155bdf 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -110,7 +110,9 @@ class TestNamedTuple(unittest.TestCase): n = 10000 import string, random - names = [''.join([random.choice(string.letters) for j in range(10)]) for i in range(n)] + names = list(set(''.join([random.choice(string.ascii_letters) + for j in range(10)]) for i in range(n))) + n = len(names) Big = namedtuple('Big', names) b = Big(*range(n)) self.assertEqual(b, tuple(range(n))) -- 2.50.0