diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2011-03-16 20:32:41 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2011-03-16 20:32:41 -0400 |
commit | 077d39eed98851e0232e208be832e4a77dee878c (patch) | |
tree | 16df0e8786321bcd662e4fe786d1e47ec9ba1c6e | |
parent | cf6fbd6156e8717da1ce23c70cea93322e7e4bd6 (diff) | |
download | python-coveragepy-git-077d39eed98851e0232e208be832e4a77dee878c.tar.gz |
Clean-ups
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rw-r--r-- | coverage/backward.py | 6 | ||||
-rw-r--r-- | coverage/control.py | 4 | ||||
-rw-r--r-- | setup.py | 2 |
4 files changed, 9 insertions, 5 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index e9d91286..768b582c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -27,7 +27,7 @@ Version 3.5 Closes `issue 107`, thanks, Brett Cannon. - Installation from source now succeeds on machines without a C compiler, - closing `issue 80`. + closing `issue 80`. - Internally, files are now closed explicitly, fixing `issue 104`. Thanks, Brett Cannon. 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. @@ -116,7 +116,7 @@ if sys.version_info >= (3, 0): # extension. Try it with, and if it fails, try it without. try: setup(**setup_args) -except: +except: # pylint: disable=W0702 if 'ext_modules' not in setup_args: raise msg = "Couldn't install with extension module, trying without it..." |