class MinhaExcecao(Exception):
def __init__(self, valor):
self.__valor = valor
@property
def valor(self):
return self.__valor
def alguma_funcao():
def outra_funcao():
try:
alguma_funcao()
except MinhaExcecao as e:
print(e.valor)
outra_funcao()
Y2xhc3MgTWluaGFFeGNlY2FvKEV4Y2VwdGlvbik6CiAgICBkZWYgX19pbml0X18oc2VsZiwgdmFsb3IpOgogICAgICAgIHNlbGYuX192YWxvciA9IHZhbG9yCgogICAgQHByb3BlcnR5CiAgICBkZWYgdmFsb3Ioc2VsZik6CiAgICAgICAgcmV0dXJuIHNlbGYuX192YWxvcgoKZGVmIGFsZ3VtYV9mdW5jYW8oKToKICAgIHJhaXNlIE1pbmhhRXhjZWNhbyg0MikKCmRlZiBvdXRyYV9mdW5jYW8oKToKICAgIHRyeToKICAgICAgICBhbGd1bWFfZnVuY2FvKCkKICAgIGV4Y2VwdCBNaW5oYUV4Y2VjYW8gYXMgZToKICAgICAgICBwcmludChlLnZhbG9yKQoKb3V0cmFfZnVuY2FvKCk=