Skip to content

Commit 312876d

Browse files
committed
Simplify the PYDANTIC_V2 calculation
1 parent ee11eaa commit 312876d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

openapi_pydantic/compat.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
from pydantic.version import VERSION as PYDANTIC_VERSION
66

77
PYDANTIC_MAJOR_VERSION = int(PYDANTIC_VERSION.split(".", 1)[0])
8-
9-
if int(PYDANTIC_MAJOR_VERSION) >= 2:
10-
PYDANTIC_V2 = True
11-
else:
12-
PYDANTIC_V2 = False
8+
PYDANTIC_V2 = int(PYDANTIC_MAJOR_VERSION) >= 2
139

1410
if TYPE_CHECKING:
1511
# Provide stubs for either version of Pydantic

0 commit comments

Comments
 (0)