diff options
Diffstat (limited to 'coverage')
-rw-r--r-- | coverage/backward.py | 6 | ||||
-rw-r--r-- | coverage/control.py | 4 |
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. |