summaryrefslogtreecommitdiff
path: root/coverage
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
parentcf6fbd6156e8717da1ce23c70cea93322e7e4bd6 (diff)
downloadpython-coveragepy-git-077d39eed98851e0232e208be832e4a77dee878c.tar.gz
Clean-ups
Diffstat (limited to 'coverage')
-rw-r--r--coverage/backward.py6
-rw-r--r--coverage/control.py4
2 files changed, 7 insertions, 3 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
diff --git a/coverage/control.py b/coverage/control.py
index 514f23d9..3369d04e 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -226,8 +226,8 @@ class coverage(object):
self._check_for_packages()
# Compiled Python files have two filenames: frame.f_code.co_filename is
- # the filename at the time the .pyc was compiled. The second name
- # is __file__, which is where the .pyc was actually loaded from. Since
+ # the filename at the time the .pyc was compiled. The second name is
+ # __file__, which is where the .pyc was actually loaded from. Since
# .pyc files can be moved after compilation (for example, by being
# installed), we look for __file__ in the frame and prefer it to the
# co_filename value.