Python3 compatibility fix

Use except .. as instead of the obsoleted comma syntax.