Updated "except" statement for python 3+