Merge pull request #4213 from asottile/flake8_master_fixes
Fixes for flake8 master
This commit is contained in:
commit
799b72cf6f
|
@ -1,6 +1,5 @@
|
||||||
|
|
||||||
def test_exception_syntax():
|
def test_exception_syntax():
|
||||||
try:
|
try:
|
||||||
0/0
|
0 / 0
|
||||||
except ZeroDivisionError, e:
|
except ZeroDivisionError, e:
|
||||||
pass
|
assert e
|
||||||
|
|
|
@ -2,4 +2,4 @@ def test_exception_syntax():
|
||||||
try:
|
try:
|
||||||
0 / 0
|
0 / 0
|
||||||
except ZeroDivisionError as e:
|
except ZeroDivisionError as e:
|
||||||
pass
|
assert e
|
||||||
|
|
|
@ -706,10 +706,9 @@ class AssertionRewriter(ast.NodeVisitor):
|
||||||
setattr(node, name, new)
|
setattr(node, name, new)
|
||||||
elif (
|
elif (
|
||||||
isinstance(field, ast.AST)
|
isinstance(field, ast.AST)
|
||||||
and
|
|
||||||
# Don't recurse into expressions as they can't contain
|
# Don't recurse into expressions as they can't contain
|
||||||
# asserts.
|
# asserts.
|
||||||
not isinstance(field, ast.expr)
|
and not isinstance(field, ast.expr)
|
||||||
):
|
):
|
||||||
nodes.append(field)
|
nodes.append(field)
|
||||||
|
|
||||||
|
|
|
@ -245,8 +245,8 @@ def make_numbered_dir_with_cleanup(root, prefix, keep, lock_timeout):
|
||||||
p = make_numbered_dir(root, prefix)
|
p = make_numbered_dir(root, prefix)
|
||||||
lock_path = create_cleanup_lock(p)
|
lock_path = create_cleanup_lock(p)
|
||||||
register_cleanup_lock_removal(lock_path)
|
register_cleanup_lock_removal(lock_path)
|
||||||
except Exception as e:
|
except Exception as exc:
|
||||||
pass
|
e = exc
|
||||||
else:
|
else:
|
||||||
consider_lock_dead_if_created_before = p.stat().st_mtime - lock_timeout
|
consider_lock_dead_if_created_before = p.stat().st_mtime - lock_timeout
|
||||||
cleanup_numbered_dir(
|
cleanup_numbered_dir(
|
||||||
|
|
Loading…
Reference in New Issue