Skip to content

Commit 86de278

Browse files
Merge pull request #795 from xzycn/develop
fix #794
2 parents 676fd02 + 120a8b9 commit 86de278

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hug/types.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import uuid as native_uuid
2525
from decimal import Decimal
26+
from distutils.version import LooseVersion
2627

2728
import hug._empty as empty
2829
from hug import introspect
@@ -34,7 +35,9 @@
3435
import marshmallow
3536
from marshmallow import ValidationError
3637

37-
MARSHMALLOW_MAJOR_VERSION = marshmallow.__version_info__[0]
38+
MARSHMALLOW_MAJOR_VERSION = getattr(
39+
marshmallow, "__version_info__", LooseVersion(marshmallow.__version__).version
40+
)[0]
3841
except ImportError:
3942
# Just define the error that is never raised so that Python does not complain.
4043
class ValidationError(Exception):

0 commit comments

Comments
 (0)