Skip to content

Commit

Permalink
Fix import of create_model in tools.py (#6364)
Browse files Browse the repository at this point in the history
  • Loading branch information
SharathHuddar committed Jul 2, 2023
1 parent 0e8a387 commit 2c0e2a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changes/6361-SharathHuddar.md
Original file line number Diff line number Diff line change
@@ -0,0 +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
2 changes: 1 addition & 1 deletion pydantic/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _generate_parsing_type_name(type_: Any) -> str:

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

if type_name is None:
type_name = _generate_parsing_type_name
Expand Down

0 comments on commit 2c0e2a6

Please sign in to comment.