From 7354d6722f15537b463b289da93440306504076e Mon Sep 17 00:00:00 2001 From: George Sibble Date: Thu, 28 Feb 2013 15:04:35 -0800 Subject: [PATCH 1/2] Include TypeError Detection Check for NoneType in Python --- src/main/resources/python/swagger.mustache | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/python/swagger.mustache b/src/main/resources/python/swagger.mustache index e06263e8d39..7ea42914a86 100644 --- a/src/main/resources/python/swagger.mustache +++ b/src/main/resources/python/swagger.mustache @@ -164,6 +164,8 @@ class ApiClient: value = attrType(value) except UnicodeEncodeError: value = unicode(value) + except TypeError: + value = value setattr(instance, attr, value) elif (attrType == 'datetime'): setattr(instance, attr, datetime.datetime.strptime(value[:-5], From 55cf01d9f7383becc71708f965d659b75f071e49 Mon Sep 17 00:00:00 2001 From: George Sibble Date: Thu, 28 Feb 2013 15:06:59 -0800 Subject: [PATCH 2/2] Also for Python 3 --- src/main/resources/python3/swagger.mustache | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/python3/swagger.mustache b/src/main/resources/python3/swagger.mustache index bc6f7ef7ce4..7000827e0ba 100644 --- a/src/main/resources/python3/swagger.mustache +++ b/src/main/resources/python3/swagger.mustache @@ -159,6 +159,8 @@ class ApiClient: value = attrType(value) except UnicodeEncodeError: value = unicode(value) + except TypeError: + value = value setattr(instance, attr, value) elif (attrType == 'datetime'): setattr(instance, attr, datetime.datetime.strptime(value[:-5],