class Yoba:
def __enter__(self):
print("voshli")
return self
def __exit__(self, *exc_info):
print("vishli")
try:
with Yoba():
raise Exception("SOSI HOOY!")
except Exception as e:
print(e)
Y2xhc3MgWW9iYToKCWRlZiBfX2VudGVyX18oc2VsZik6CgkJcHJpbnQoInZvc2hsaSIpCgkJcmV0dXJuIHNlbGYKCWRlZiBfX2V4aXRfXyhzZWxmLCAqZXhjX2luZm8pOgoJCXByaW50KCJ2aXNobGkiKQp0cnk6Cgl3aXRoIFlvYmEoKToKCQlyYWlzZSBFeGNlcHRpb24oIlNPU0kgSE9PWSEiKQpleGNlcHQgRXhjZXB0aW9uIGFzIGU6CglwcmludChlKQ==