Minor rework of Parser.parse
@@ -358,7 +358,7 @@ class Parser(object):
"""
req = req if req is not None else self.get_default_request()
assert req is not None, 'Must pass req object'
- ret = None
+ data = None
validators = _ensure_list_of_callables(validate)
schema = self._get_schema(argmap, req)
try:
@@ -368,14 +368,11 @@ class Parser(object):
self._validate_arguments(data, validators)
except ma.exceptions.ValidationError as error:
self._on_validation_error(error)
- else:
- data = result.data if MARSHMALLOW_VERSION_INFO[0] < 3 else result
- ret = data
finally:
self.clear_cache()
if force_all:
- fill_in_missing_args(ret, schema)
- return ret
+ fill_in_missing_args(data, schema)
+ return data
def clear_cache(self):
"""Invalidate the parser's cache."""
