Isolate some bugs in the autofixer
This commit is contained in:
@@ -393,6 +393,7 @@ pub fn lint_fix<'a>(
|
||||
// longer parseable on a subsequent pass, then we've introduced a
|
||||
// syntax error. Return the original code.
|
||||
if parseable && result.error.is_some() {
|
||||
println!("{}", transformed);
|
||||
#[allow(clippy::print_stderr)]
|
||||
{
|
||||
eprintln!(
|
||||
|
||||
21
foo.py
Normal file
21
foo.py
Normal file
@@ -0,0 +1,21 @@
|
||||
def f():
|
||||
with Nested(m) as (foo):
|
||||
pass
|
||||
|
||||
def f():
|
||||
# Issue #23192: Test that a lambda returning a generator behaves
|
||||
# like the equivalent function
|
||||
f = lambda: (yield 1)
|
||||
def g(): return (yield 1)
|
||||
|
||||
# test 'yield from'
|
||||
f2 = lambda: (yield from g())
|
||||
def g2(): return (yield from g())
|
||||
|
||||
f3 = lambda: (yield from f())
|
||||
|
||||
def f():
|
||||
# Remove `toplevel`.
|
||||
toplevel = tt = lexer.get_token()
|
||||
if not tt:
|
||||
break
|
||||
Reference in New Issue
Block a user