We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 888b8bd commit ceea00bCopy full SHA for ceea00b
samtranslator/compat.py
@@ -1,8 +1,15 @@
1
try:
2
from pydantic import v1 as pydantic
3
+
4
+ # Starting Pydantic v1.10.17, pydantic import v1 will success,
5
+ # adding the following line to make Pydantic v1 should fall back to v1 import correctly.
6
+ pydantic.error_wrappers.ValidationError # noqa
7
except ImportError:
8
# Unfortunately mypy cannot handle this try/expect pattern, and "type: ignore"
9
# is the simplest work-around. See: https://github.com/python/mypy/issues/1153
10
import pydantic # type: ignore
11
+except AttributeError:
12
+ # Pydantic v1.10.17+
13
+ import pydantic # type: ignore
14
15
__all__ = ["pydantic"]
0 commit comments