I think simply running 2to3 with -d flag would actually fix this issue
Martin von Löwis
Yes, you should integrate doctest conversion into setup.py. This should be done through 2to3 API, though, rather than invoking a command line 2to3. In any case, you should only run it on files that were just copied into the build area, rather than on all files (which may take forever).
Unfortunately, distutils.util.run_2to3 doesn't support passing the doctests_only flag to RefactoringTool, so you would have to copy that.