Largely automated print function style in the doctests.

Plus some manual tweaking to ensure the doctests still pass
(e.g. on Jython 2.7b1, see last commit).

import os
from lib2to3.main import main

for dirpath, dirnames, filenames in os.walk("."):
    if dirpath.startswith("./build/") or dirpath.startwith("./.git/"):
        continue
    print("=" * len(dirpath))
    print(dirpath)
    print("=" *len(dirpath))
    for f in filenames:
        if not f.endswith(".py"):
            continue
        filename = os.path.join(dirpath, f)
        with open(filename) as h:
            data = h.read()
            if "print " not in data:
                continue
            if "print(" in data:
                continue
        print(filename)
        e = main("lib2to3.fixes", ["-d", filename, "-f", "print", "-w", "-n"])
        if e != 0:
            os.remove(filename)
            raise RuntimeError("Error %i from 2to3 (doctests) on %s"
                               % (e, filename))