[tor-commits] [stem/master] Don't retain whitespace when showing pyflake issues

atagar at torproject.org atagar at torproject.org
Sun Jul 26 01:03:39 UTC 2015

commit 2518917325ca9e74263e384544d1d38b5fb5d383
Author: Damian Johnson <atagar at torproject.org>
Date:   Sat Jul 25 18:02:37 2015 -0700

    Don't retain whitespace when showing pyflake issues
    While it's neat that we now show the code pyflake issues are citing, the
    whitespace isn't helpful. The ending newline is especially pesky since it
    double spaces the entries.
 stem/util/test_tools.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stem/util/test_tools.py b/stem/util/test_tools.py
index 9081dcd..dac9fc7 100644
--- a/stem/util/test_tools.py
+++ b/stem/util/test_tools.py
@@ -295,7 +295,7 @@ def pyflakes_issues(paths):
       def _register_issue(self, path, line_number, issue, line):
         if not self._is_ignored(path, issue):
           if path and line_number and not line:
-            line = linecache.getline(path, line_number)
+            line = linecache.getline(path, line_number).strip()
           issues.setdefault(path, []).append(Issue(line_number, issue, line))

More information about the tor-commits mailing list