Fix coverage_doctest.py to work in Python 3
Fix pyflakes warnings in coverage_doctest.py
Merge pull request #2951 from asmeurer/coverage_doctest_py3

Make coverage_doctest.py work in Python 3