runtests.py: use except-as syntax