Skip to content

Commit

Permalink
GH #887 - Fix 'TypeError: isinstance() arg 2 ..' with datetime.date.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsuch committed Sep 26, 2018
1 parent 81bdc5a commit 5aefb03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/zato-server/src/zato/server/service/reqresp/sio.py
Expand Up @@ -319,8 +319,8 @@ class Date(ForceType):
def __init__(self, name, format='%Y-%m-%d', *args, **kwargs): def __init__(self, name, format='%Y-%m-%d', *args, **kwargs):
super(Date, self).__init__(name, format=format, *args, **kwargs) super(Date, self).__init__(name, format=format, *args, **kwargs)


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


from_xml = to_json = to_xml = from_json from_xml = to_json = to_xml = from_json


Expand Down

0 comments on commit 5aefb03

Please sign in to comment.