(self)
| 5958 | self._assert_is_copy(obj, objcopy2) |
| 5959 | |
| 5960 | def test_issue24097(self): |
| 5961 | # Slot name is freed inside __getattr__ and is later used. |
| 5962 | class S(str): # Not interned |
| 5963 | pass |
| 5964 | class A: |
| 5965 | __slotnames__ = [S('spam')] |
| 5966 | def __getattr__(self, attr): |
| 5967 | if attr == 'spam': |
| 5968 | A.__slotnames__[:] = [S('spam')] |
| 5969 | return 42 |
| 5970 | else: |
| 5971 | raise AttributeError |
| 5972 | |
| 5973 | import copyreg |
| 5974 | expected = (copyreg.__newobj__, (A,), (None, {'spam': 42}), None, None) |
| 5975 | self.assertEqual(A().__reduce_ex__(2), expected) # Shouldn't crash |
| 5976 | |
| 5977 | def test_object_reduce(self): |
| 5978 | # Issue #29914 |
nothing calls this directly
no test coverage detected