Commit 2d49359b authored by Spiros Koulouzis's avatar Spiros Koulouzis

fixed bug ERROR:root:module 'typing' has no attribute 'GenericMeta'

parent aff2a5db
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6 (sure_tosca-flask-server)" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (sure_tosca-flask-server)" project-jdk-type="Python SDK" />
<component name="PyCharmProfessionalAdvertiser"> <component name="PyCharmProfessionalAdvertiser">
<option name="shown" value="true" /> <option name="shown" value="true" />
</component> </component>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4"> <module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" /> <content url="file://$MODULE_DIR$">
<orderEntry type="jdk" jdkName="Python 3.6 (sure_tosca-flask-server)" jdkType="Python SDK" /> <excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.7 (sure_tosca-flask-server)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
<component name="TestRunnerService"> <component name="TestRunnerService">
......
...@@ -3,4 +3,4 @@ python-dateutil == 2.8.0 ...@@ -3,4 +3,4 @@ python-dateutil == 2.8.0
typing == 3.7.4.1 typing == 3.7.4.1
swagger-ui-bundle == 0.0.5 swagger-ui-bundle == 0.0.5
tinydb == 3.15.1 tinydb == 3.15.1
tosca-parser ==1.6.1 tosca-parser ==1.6.1
\ No newline at end of file
...@@ -23,10 +23,10 @@ def _deserialize(data, klass): ...@@ -23,10 +23,10 @@ def _deserialize(data, klass):
return deserialize_date(data) return deserialize_date(data)
elif klass == datetime.datetime: elif klass == datetime.datetime:
return deserialize_datetime(data) return deserialize_datetime(data)
elif type(klass) == typing.GenericMeta: elif hasattr(klass, '__origin__'):
if klass.__extra__ == list: if klass.__origin__ == list:
return _deserialize_list(data, klass.__args__[0]) return _deserialize_list(data, klass.__args__[0])
if klass.__extra__ == dict: if klass.__origin__ == dict:
return _deserialize_dict(data, klass.__args__[1]) return _deserialize_dict(data, klass.__args__[1])
else: else:
return deserialize_model(data, klass) return deserialize_model(data, klass)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment