Make twisted/python/* importable under Python 3
|Reported by:||Vladimir Perić||Owned by:||Vladimir Perić|
The first step to converting to Python 3 is making the files importable. This ticket does that for all the files in twisted/python/ (plus the few files they bring in via imports). Most of the changes can be grouped in the following few categories:
- Simple syntax changes: "except E, V:" to "except E as V"; "raises E, text" to "raises(text)", "print blah" to "print(blah)"
- Module relocation
- changing the zope.fixers function implements to the @implementer decorator
I also introduced two new functions to the t.p.compat module, both taken from the "six" library, reraise() and exec_(), to handle syntax differences in these statements.
This is a prerequisite for ticket #5802 (in fact, I started this thinking it'd be a smaller patch but I was a bit wrong :)). It's also a prerequisite for any other work (eg. enabling trial to run under Python 3), so it would be great if it'd get checked soon. I realize the ticket is quite large, so I'm open to ideas on how to split it into smaller patches. I'm submitting it here as a large patchset, but I have it split into about 20 commits (mostly grouped by error) so splitting it will be easy.
Note, this patch also suffers from the failures I mentioned in the other ticket, and I'm quite stumped with them so any help will be appreciated!