Skip to content

Support Python 2.7

Barry Warsaw requested to merge py27 into master

No doubt this will look like a big change, but you've already seen most of it. :) It's big because I had to separate out the Python 2 and 3 bits into separate modules, and handle a bunch of compatibility stuffs.

I am ignoring coverage wholesale on several files. I don't think the __init__.py, _compat.py, or abc.py modules really need coverage, and actually adding them was a bit problematic, since at least the first two are designed not to be fully covered across individual Python interpreter version runs. The latter isn't really designed to be called either.

I think I've cleaned up the comments a bit too, but definitely check to make sure I haven't left anything blatantly incorrect in them. :) I removed a bit of code from what you saw yesterday because it just wasn't being covered and on further consideration, seemed impossible to reach in Python 2. I wouldn't be surprised if future bug reports prove me wrong.

I used more from-imports because I think it makes the import blocks scan better, and provides shorter lines in the body of the code, which does help if we need to e.g. add pragmas later, or are annoyed by multiline statements (they annoy me anyway :).

tox should now fully pass, although I don't have Python 3.4 installed locally to check that. Let's see what CI says.

Closes #15 (closed)

Merge request reports