Merge pull request #4213 from asottile/flake8_master_fixes

Fixes for flake8 master
This commit is contained in:
Anthony Sottile 2018-10-22 20:08:38 -07:00 committed by GitHub
commit 799b72cf6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 8 deletions

View File

@ -1,6 +1,5 @@
def test_exception_syntax():
try:
0/0
0 / 0
except ZeroDivisionError, e:
pass
assert e

View File

@ -2,4 +2,4 @@ def test_exception_syntax():
try:
0 / 0
except ZeroDivisionError as e:
pass
assert e

View File

@ -706,10 +706,9 @@ class AssertionRewriter(ast.NodeVisitor):
setattr(node, name, new)
elif (
isinstance(field, ast.AST)
and
# Don't recurse into expressions as they can't contain
# asserts.
not isinstance(field, ast.expr)
and not isinstance(field, ast.expr)
):
nodes.append(field)

View File

@ -245,8 +245,8 @@ def make_numbered_dir_with_cleanup(root, prefix, keep, lock_timeout):
p = make_numbered_dir(root, prefix)
lock_path = create_cleanup_lock(p)
register_cleanup_lock_removal(lock_path)
except Exception as e:
pass
except Exception as exc:
e = exc
else:
consider_lock_dead_if_created_before = p.stat().st_mtime - lock_timeout
cleanup_numbered_dir(