MCPcopy Index your code
hub / github.com/python/cpython / EvilGetattribute

Class EvilGetattribute

Lib/test/test_descr.py:5033–5041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5031 self.assertEqual(descr.counter, 4)
5032
5033 class EvilGetattribute(object):
5034 # This used to segfault
5035 def __getattr__(self, name):
5036 raise AttributeError(name)
5037 def __getattribute__(self, name):
5038 del EvilGetattribute.__getattr__
5039 for i in range(5):
5040 gc.collect()
5041 raise AttributeError(name)
5042
5043 self.assertRaises(AttributeError, getattr, EvilGetattribute(), "attr")
5044

Callers 1

test_getattr_hooksMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_getattr_hooksMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…