use sys.monitoring instead of sys.settrace at py3.12+
use sys.monitoring instead of sys.settrace at py3.12+