modified for PYTHONOPTIMIZE=1