Updated all Python files to use PEP-3110 exception syntax for Python3 compatibility.