Replacing it with  `except TypeError as e` should fix Python 3 error