[tor-commits] [stem/master] Check that except clauses are not using old grammar

atagar at torproject.org atagar at torproject.org
Mon May 6 01:09:36 UTC 2013


commit e65930b402cf4edee8ae18a812af4b3ea1aeeb21
Author: Sean Robinson <seankrobinson at gmail.com>
Date:   Thu May 2 16:15:26 2013 -0700

    Check that except clauses are not using old grammar
    
    This tests that code matches PEP3110 and is more Python 3 compatible
    out of the box.  This is possible because we no longer support
    Python 2.5.
    
    Signed-off-by: Sean Robinson <seankrobinson at gmail.com>
---
 test/util.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/test/util.py b/test/util.py
index 309851b..dbd776f 100644
--- a/test/util.py
+++ b/test/util.py
@@ -279,6 +279,8 @@ def get_stylistic_issues(paths):
           file_issues.append((index + 1, "contains a windows newline"))
         elif content != content.rstrip():
           file_issues.append((index + 1, "line has trailing whitespace"))
+        elif content.lstrip().startswith("except") and content.endswith(", exc:"):
+          file_issues.append((index + 1, "except clause should use 'as', not comma"))
 
       if file_issues:
         issues[file_path] = file_issues





More information about the tor-commits mailing list