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

@ -13,9 +13,9 @@ pub fn useless_object_inheritance(
) {
let scope = checker.current_scope();
if let Some(mut check) = checks::useless_object_inheritance(name, bases, scope) {
if checker.autofix.enabled() {
if checker.patch() {
if let Some(fix) = pyupgrade::fixes::remove_class_def_base(
&mut checker.locator,
checker.get_locator(),
&stmt.location,
check.location,
bases,