Python 2 started out with the raise Type, Value, Traceback syntax. Python 3 instead requires raise Type(Value). Likewise, Python 2 started out with except Type, var to catch exceptions, while Python 3 requires except Type as var. Use the Python 3 formats, both of which are also supported in more recent Python 2.
This patch probably depends on 18 and 19. Import those first.