From a309f08287e3bc3f50e2c97feaa44e6b2523d355 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 6 Oct 2021 20:31:19 -0400 Subject: [PATCH] fix: make exceptions importable from coverage.misc again. #1226 --- CHANGES.rst | 9 ++++++++- coverage/misc.py | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 784fa5c29..3dea0df17 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -22,6 +22,12 @@ 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`_). @@ -29,8 +35,9 @@ Unreleased 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: diff --git a/coverage/misc.py b/coverage/misc.py index cd4a77401..0f985be0e 100644 --- a/coverage/misc.py +++ b/coverage/misc.py @@ -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 = {}