Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
annatisch committed May 17, 2016
1 parent 9f62082 commit 640df1a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ClientRuntimes/Python/msrest/msrest/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def serialize_data(self, data, data_type, **kwargs):

enum_type = self.dependencies.get(data_type)
if enum_type and issubclass(enum_type, Enum):
return self.serialize_enum(data, enum_obj=enum_type, **kwargs)
return Serializer.serialize_enum(data, enum_obj=enum_type)

iter_type = data_type[0] + data_type[-1]
if iter_type in self.serialize_type:
Expand Down Expand Up @@ -540,7 +540,8 @@ def serialize_object(self, attr, **kwargs):
else:
return str(attr)

def serialize_enum(self, attr, enum_obj=None, **kwagrs):
@staticmethod
def serialize_enum(attr, enum_obj=None):
try:
return attr.value
except AttributeError:
Expand Down Expand Up @@ -728,7 +729,7 @@ def __call__(self, target_obj, response_data):

if isinstance(response, basestring):
return self.deserialize_data(data, response)
elif issubclass(response, Enum):
elif isinstance(response, type) and issubclass(response, Enum):
return self.deserialize_enum(data, response)

if data is None:
Expand Down

0 comments on commit 640df1a

Please sign in to comment.