diff -r 4d3557500019 Lib/test/test_descr.py --- a/Lib/test/test_descr.py Sat Jul 18 23:37:31 2015 +0300 +++ b/Lib/test/test_descr.py Mon Jul 20 00:11:59 2015 +0300 @@ -5028,6 +5028,19 @@ class PicklingTests(unittest.TestCase): objcopy2 = deepcopy(objcopy) self._assert_is_copy(obj, objcopy2) + def test_issue24097(self): + class S(str): + pass + class A: + __slotnames__ = [S('spam')] + def __getattr__(self, attr): + if attr == 'spam': + A.__slotnames__[:] = [S('spam')] + return 42 + else: + raise AttributeError + + A().__reduce__(2) class SharedKeyTests(unittest.TestCase):