with_statement is available naturally in Python 2.6
Compute PY3 directly and switch on that for clarity.
Add a PY2 also.
Use PY3 and PY2 throughout