From 03331d95005a3f782e12932f411f7ba7d51c9fbe Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 7 Nov 2012 20:02:41 -0500 Subject: Of course, it's different on Py3. --- coverage/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'coverage/__init__.py') diff --git a/coverage/__init__.py b/coverage/__init__.py index 4d82375..a10b4a6 100644 --- a/coverage/__init__.py +++ b/coverage/__init__.py @@ -83,7 +83,10 @@ annotate = _singleton_method('annotate') # This makes some inspection tools (like pydoc) unable to find the class # coverage.coverage. So remove that entry. import sys -del sys.modules['coverage.coverage'] +try: + del sys.modules['coverage.coverage'] +except KeyError: + pass # COPYRIGHT AND LICENSE # -- cgit v1.2.1