fork(1) download
  1. class Yoba:
  2. def __enter__(self):
  3. print("voshli")
  4. return self
  5. def __exit__(self, *exc_info):
  6. print("vishli")
  7. try:
  8. with Yoba():
  9. raise Exception("SOSI HOOY!")
  10. except Exception as e:
  11. print(e)
Success #stdin #stdout 0.02s 9984KB
stdin
Standard input is empty
stdout
voshli
vishli
SOSI HOOY!