diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-11-08 19:16:07 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-11-08 19:16:07 -0500 |
commit | 669ac29df4931d07399a8f4779895cff2a2821c4 (patch) | |
tree | a269396e3203187dcdfdc7cff4ef3ccf55dbb871 /coverage/backward.py | |
parent | 5e5a786db1b5b9d36398f715520ad7561916e1cc (diff) | |
download | python-coveragepy-git-669ac29df4931d07399a8f4779895cff2a2821c4.tar.gz |
Use py2 ConfigParser if we can, prevents deprecation warnings. #530
Diffstat (limited to 'coverage/backward.py')
-rw-r--r-- | coverage/backward.py | 9 |
1 files changed, 6 insertions, 3 deletions
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: |