mkdocstrings · GitHub

Commit c5ecd70

committed

fix: Deactivate Pydantic logic if v1 is installed instead of v2

Issue-240: #240

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • src/mkdocstrings_handlers/python

Lines changed: 5 additions & 0 deletions

Original file line numberDiff line numberDiff line change

@@ -25,6 +25,11 @@

2525

# "yaml.schemas": {

2626

# "https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yml"

2727

# }

28+

import pydantic

29+
30+

if getattr(pydantic, "__version__", "1.").startswith("1."):

31+

raise ImportError # noqa: TRY301

32+
2833

from inspect import cleandoc

2934
3035

from pydantic import Field as BaseField

0 commit comments

Comments

 (0)

Read the original on github.com ↗