summaryrefslogtreecommitdiff
path: root/coverage/backward.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2011-03-16 20:32:41 -0400
committerNed Batchelder <ned@nedbatchelder.com>2011-03-16 20:32:41 -0400
commit077d39eed98851e0232e208be832e4a77dee878c (patch)
tree16df0e8786321bcd662e4fe786d1e47ec9ba1c6e /coverage/backward.py
parentcf6fbd6156e8717da1ce23c70cea93322e7e4bd6 (diff)
downloadpython-coveragepy-git-077d39eed98851e0232e208be832e4a77dee878c.tar.gz
Clean-ups
Diffstat (limited to 'coverage/backward.py')
-rw-r--r--coverage/backward.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/coverage/backward.py b/coverage/backward.py
index af6da629..e901d84f 100644
--- a/coverage/backward.py
+++ b/coverage/backward.py
@@ -81,19 +81,23 @@ except AttributeError:
"""Open a source file the best way."""
return open(fname, "rU")
-# Python 3.x is picky about bytes and strings, so provide methods to
+# Python 3.x is picky about bytes and strings, so provide methods to
# get them right, and make them no-ops in 2.x
if sys.version_info >= (3, 0):
def to_bytes(s):
+ """Convert string `s` to bytes."""
return s.encode('utf8')
def to_string(b):
+ """Convert bytes `b` to a string."""
return b.decode('utf8')
else:
def to_bytes(s):
+ """Convert string `s` to bytes (no-op in 2.x)."""
return s
def to_string(b):
+ """Convert bytes `b` to a string (no-op in 2.x)."""
return b