runtests.py: use except-as syntax
Merge pull request #5380 from cvrebert/patch-1

runtests.py: use except-as syntax