Skip to content

Commit

Permalink
fix: make exceptions importable from coverage.misc again. #1226
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Oct 7, 2021
1 parent f33b733 commit a309f08
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CHANGES.rst
Expand Up @@ -22,15 +22,22 @@ This list is detailed and covers changes in each pre-release version.
Unreleased
----------

- In 6.0, the coverage.py exceptions moved from coverage.misc to
coverage.exceptions. These exceptions are not part of the public supported
API, CoverageException is. But a number of other third-party packages were
importing the exceptions from coverage.misc, so they are now available from
there again (`issue 1226`_).

- Changed an internal detail of how tomli is imported, so that tomli can use
coverage.py for their own test suite (`issue 1228`_).

- Defend against an obscure possibility under code obfuscation, where a
function can have an argument called "self", but no local named "self"
(`pull request 1210`_). Thanks, Ben Carlsson.

.. _issue 1228: https://github.com/nedbat/coveragepy/issues/1228
.. _pull request 1210: https://github.com/nedbat/coveragepy/pull/1210
.. _issue 1226: https://github.com/nedbat/coveragepy/issues/1226
.. _issue 1228: https://github.com/nedbat/coveragepy/issues/1228


.. _changes_60:
Expand Down
5 changes: 5 additions & 0 deletions coverage/misc.py
Expand Up @@ -20,6 +20,11 @@
from coverage import env
from coverage.exceptions import CoverageException

# In 6.0, the exceptions moved from misc.py to exceptions.py. But a number of
# other packages were importing the exceptions from misc, so import them here.
# pylint: disable=unused-wildcard-import
from coverage.exceptions import * # pylint: disable=wildcard-import

ISOLATED_MODULES = {}


Expand Down

0 comments on commit a309f08

Please sign in to comment.