Permalink
Browse files

GH #887 - Fix 'TypeError: isinstance() arg 2 ..' with datetime.date.

  • Loading branch information...
dsuch committed Sep 26, 2018
1 parent 81bdc5a commit 5aefb03095b2035091dd0ab34c708ec297eee87a
Showing with 2 additions and 2 deletions.
  1. +2 −2 code/zato-server/src/zato/server/service/reqresp/sio.py
@@ -319,8 +319,8 @@ class Date(ForceType):
def __init__(self, name, format='%Y-%m-%d', *args, **kwargs):
super(Date, self).__init__(name, format=format, *args, **kwargs)

def from_json(self, value, _stdlib_date=datetime.date, *ignored):
return value.strftime(self.kwargs['format']) if isinstance(value, _stdlib_date) else value
def from_json(self, value, *ignored):
return value.strftime(self.kwargs['format']) if isinstance(value, datetime.date) else value

from_xml = to_json = to_xml = from_json

0 comments on commit 5aefb03

Please sign in to comment.