MCPcopy Index your code
hub / github.com/RustPython/RustPython / EvilGetattribute

Class EvilGetattribute

Lib/test/test_descr.py:4815–4823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4813 self.assertEqual(descr.counter, 4)
4814
4815 class EvilGetattribute(object):
4816 # This used to segfault
4817 def __getattr__(self, name):
4818 raise AttributeError(name)
4819 def __getattribute__(self, name):
4820 del EvilGetattribute.__getattr__
4821 for i in range(5):
4822 gc.collect()
4823 raise AttributeError(name)
4824
4825 self.assertRaises(AttributeError, getattr, EvilGetattribute(), "attr")
4826

Callers 1

test_getattr_hooksMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_getattr_hooksMethod · 0.68