NameError: name 'sys' is not defined

Issue #317 resolved
Dmitry Trofimov created an issue

Seems like sys is not imported in backward.py

Traceback (most recent call last):
  File "/home/vagrant/.pycharm_helpers/run_coverage.py", line 11, in <module>
    from coverage.cmdline import main
  File "/home/vagrant/.pycharm_helpers/coverage/__init__.py", line 10, in <module>
    from coverage.control import coverage, process_startup
  File "/home/vagrant/.pycharm_helpers/coverage/control.py", line 8, in <module>
    from coverage.annotate import AnnotateReporter
  File "/home/vagrant/.pycharm_helpers/coverage/annotate.py", line 5, in <module>
    from coverage.backward import sorted                    # pylint: disable=W0622
  File "/home/vagrant/.pycharm_helpers/coverage/backward.py", line 88, in <module>
    if sys.version_info >= (3, 0):
NameError: name 'sys' is not defined

Comments (5)

  1. Ned Batchelder repo owner

    @Dmitry Trofimov This is a very odd error. Can you supply the full contents of /home/vagrant/.pycharm_helpers/coverage/backward.py? This problem has never been reported by anyone else, and seems like a fundamental error that everyone would encounter.

  2. Dmitry Trofimov reporter

    Hi Ned, sorry for the false alarm. My coverage/backward.py got corrupted somehow and the import line was missing.

  3. Log in to comment