Skip to content

Commit 2c0e2a6

Browse files
Fix import of create_model in tools.py (#6364)
1 parent 0e8a387 commit 2c0e2a6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

changes/6361-SharathHuddar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Importing create_model in tools.py through relative path instead of absolute path - so that it doesn't import V2 code when copied over to V2 branch

pydantic/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _generate_parsing_type_name(type_: Any) -> str:
2121

2222
@lru_cache(maxsize=2048)
2323
def _get_parsing_type(type_: Any, *, type_name: Optional[NameFactory] = None) -> Any:
24-
from pydantic.main import create_model
24+
from .main import create_model
2525

2626
if type_name is None:
2727
type_name = _generate_parsing_type_name

0 commit comments

Comments
 (0)