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.
2 parents 676fd02 + 120a8b9 commit 86de278Copy full SHA for 86de278
hug/types.py
@@ -23,6 +23,7 @@
23
24
import uuid as native_uuid
25
from decimal import Decimal
26
+from distutils.version import LooseVersion
27
28
import hug._empty as empty
29
from hug import introspect
@@ -34,7 +35,9 @@
34
35
import marshmallow
36
from marshmallow import ValidationError
37
- MARSHMALLOW_MAJOR_VERSION = marshmallow.__version_info__[0]
38
+ MARSHMALLOW_MAJOR_VERSION = getattr(
39
+ marshmallow, "__version_info__", LooseVersion(marshmallow.__version__).version
40
+ )[0]
41
except ImportError:
42
# Just define the error that is never raised so that Python does not complain.
43
class ValidationError(Exception):
0 commit comments