Use lazy initialization for SourceCodeLocator (#472)

This commit is contained in:
Charlie Marsh 2022-10-26 11:27:48 -04:00 committed by GitHub
parent 2679db1d10
commit 4beea0484a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 112 additions and 94 deletions

View file

@ -16,9 +16,9 @@ pub fn super_call_with_parameters(checker: &mut Checker, expr: &Expr, func: &Exp
.map(|index| checker.parents[*index])
.collect();
if let Some(mut check) = checks::super_args(scope, &parents, expr, func, args) {
if checker.autofix.enabled() {
if checker.patch() {
if let Some(fix) =
pyupgrade::fixes::remove_super_arguments(&mut checker.locator, expr)
pyupgrade::fixes::remove_super_arguments(checker.get_locator(), expr)
{
check.amend(fix);
}