summaryrefslogtreecommitdiff
path: root/coverage/backward.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/backward.py')
-rw-r--r--coverage/backward.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/coverage/backward.py b/coverage/backward.py
index 58d9cfea..340dc130 100644
--- a/coverage/backward.py
+++ b/coverage/backward.py
@@ -1,3 +1,6 @@
+# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
+# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
+
"""Add things to old Pythons so I can pretend they are newer."""
# This file does lots of tricky stuff, so disable a bunch of pylint warnings.
@@ -16,6 +19,12 @@ try:
except ImportError:
from io import StringIO
+# In py3, ConfigParser was renamed to the more-standard configparser
+try:
+ import configparser
+except ImportError:
+ import ConfigParser as configparser
+
# What's a string called?
try:
string_class = basestring
@@ -28,12 +37,6 @@ try:
except NameError:
unicode_class = str
-# Where do pickles come from?
-try:
- import cPickle as pickle
-except ImportError:
- import pickle
-
# range or xrange?
try:
range = xrange
@@ -155,7 +158,6 @@ def import_local_file(modname):
with open(modfile, 'r') as f:
# pylint: disable=undefined-loop-variable
- # (Using possibly undefined loop variable 'suff')
mod = imp.load_module(modname, f, modfile, suff)
return mod