Skip to content

Commit 059d37a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 1407cba commit 059d37a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/pluggy/_manager.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,15 @@ def parse_hookimpl_opts(self, plugin: _Plugin, name: str) -> HookimplOpts | None
187187
plugin_class = plugin if inspect.isclass(plugin) else type(plugin)
188188
if isinstance(getattr(plugin_class, name, None), property):
189189
return None
190-
190+
191191
# if attr is field on a pydantic model, skip it (pydantic fields are never hookimpls)
192-
if hasattr(plugin, '__pydantic_core_schema__') and name in getattr(plugin, 'model_fields', {}):
193-
# pydantic can present class attributes, instance attributes, or methods
192+
if hasattr(plugin, "__pydantic_core_schema__") and name in getattr(
193+
plugin, "model_fields", {}
194+
):
195+
# pydantic can present class attributes, instance attributes, or methods
194196
# but none of them can be hookimpls so they throw off the logic below
195197
return None
196-
198+
197199
method: object = getattr(plugin, name)
198200
if not inspect.isroutine(method):
199201
return None

0 commit comments

Comments
 (0)