mirror of https://github.com/astral-sh/ruff
Isolate some bugs in the autofixer
This commit is contained in:
parent
86d0749ed7
commit
ca3b4224d0
|
|
@ -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!(
|
||||
|
|
|
|||
|
|
@ -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
|
||||
Loading…
Reference in New Issue