summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.rst4
-rw-r--r--coverage/backward.py9
2 files changed, 10 insertions, 3 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index e7c5760a..4a6d0edf 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -43,6 +43,9 @@ Unreleased
- Fixed an unusual bug involving multiple coding declarations affecting code
containing code in multi-line strings: `issue 529`_.
+- Prevented deprecation warnings from configparser that happened in some
+ circumstatnces, closing `issue 530`_.
+
- Corrected the name of the jquery.ba-throttle-debounce.js library. Thanks,
Ben Finney. Closes `issue 505`_.
@@ -55,6 +58,7 @@ Unreleased
.. _issue 516: https://bitbucket.org/ned/coveragepy/issues/516/running-coverage-combine-twice-deletes-all
.. _issue 525: https://bitbucket.org/ned/coveragepy/issues/525/coverage-combine-when-not-in-parallel-mode
.. _issue 529: https://bitbucket.org/ned/coveragepy/issues/529/encoding-marker-may-only-appear-on-the
+.. _issue 530: https://bitbucket.org/ned/coveragepy/issues/530/deprecationwarning-you-passed-a-bytestring
Version 4.2 --- 2016-07-26
diff --git a/coverage/backward.py b/coverage/backward.py
index 00fffa54..c7b607a9 100644
--- a/coverage/backward.py
+++ b/coverage/backward.py
@@ -17,11 +17,14 @@ try:
except ImportError:
from io import StringIO
-# In py3, ConfigParser was renamed to the more-standard configparser
+# In py3, ConfigParser was renamed to the more-standard configparser.
+# But there's a py3 backport that installs "configparser" in py2, and I don't
+# want it because it has annoying deprecation warnings. So try the real py2
+# import first.
try:
- import configparser
-except ImportError:
import ConfigParser as configparser
+except ImportError:
+ import configparser
# What's a string called?
try: