Files
codeql/python/ql/test/query-tests/Exceptions/general/pypy_test.py
2026-06-15 16:15:17 +01:00

20 lines
483 B
Python

def test():
class A(BaseException):
class __metaclass__(type):
def __getattribute__(self, name):
if flag and name == '__bases__':
fail("someone read bases attr")
else:
return type.__getattribute__(self, name)
try:
a = A()
raise a
except 42: # $ Alert[py/useless-except]
#Some comment
pass
except A:
#Another comment
pass