[tor-commits] [stem/master] Drop check for python 2.6 style exception catching

atagar at torproject.org atagar at torproject.org
Sun Jan 5 21:39:28 UTC 2020


commit f74f10dead195e82f3fb6d5d519e1f0fddf498f0
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Jan 5 12:49:13 2020 -0800

    Drop check for python 2.6 style exception catching
---
 stem/util/test_tools.py | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/stem/util/test_tools.py b/stem/util/test_tools.py
index 02d3dd89..d65b3ea4 100644
--- a/stem/util/test_tools.py
+++ b/stem/util/test_tools.py
@@ -471,21 +471,6 @@ def stylistic_issues(paths, check_newlines = False, check_exception_keyword = Fa
           if '"""' in content:
             is_block_comment = not is_block_comment
 
-          if check_exception_keyword and content.startswith('except') and content.endswith(', exc:'):
-            # Python 2.6 - 2.7 supports two forms for exceptions...
-            #
-            #   except ValueError, exc:
-            #   except ValueError as exc:
-            #
-            # The former is the old method and no longer supported in python 3
-            # going forward.
-
-            # TODO: This check only works if the exception variable is called
-            # 'exc'. We should generalize this via a regex so other names work
-            # too.
-
-            issues.setdefault(filename, []).append(Issue(index + 1, "except clause should use 'as', not comma", line))
-
           if prefer_single_quotes and not is_block_comment:
             if '"' in content and "'" not in content and '"""' not in content and not content.endswith('\\'):
               # Checking if the line already has any single quotes since that





More information about the tor-commits mailing list