File size: 219 Bytes
b0b44df
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import sys
import traceback


def run(code, task):
    try:
        code()
    except Exception as e:
        print(f"{task}: {type(e).__name__}", file=sys.stderr)
        print(traceback.format_exc(), file=sys.stderr)