Skip to content

Commit

Permalink
Merge pull request #11 from MaRDI4NFDI/deepsource-autofix-004cb4f1
Browse files Browse the repository at this point in the history
refactor: use `is` to compare type of objects
  • Loading branch information
physikerwelt authored Jan 7, 2024
2 parents 7353875 + dafd7e8 commit b1c1941
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/zbmath_rest2oai/getWithSwagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def func_get_doc_to_xml(obj, xml):
if type(obj) in swagger_client_dicttype_list:
obj = obj.__dict__

if type(obj) == list:
if type(obj) is list:
for i in range(len(obj)):

if xml.lastChild.nodeName in ["zbmath:author_ids","zbmath:author_id", "zbmath:review","zbmath:keywords","zbmath:keyword"]:
Expand Down Expand Up @@ -118,7 +118,7 @@ def func_get_doc_to_xml(obj, xml):
func_get_doc_to_xml(obj[i], xml)


if type(obj) == dict:
if type(obj) is dict:
new_obj = dict()
for key_init in obj.keys():
if key_init in d.keys():
Expand Down Expand Up @@ -177,7 +177,7 @@ def func_get_doc_to_xml(obj, xml):
if type(new_obj[key]) not in [list,dict]:
new_obj[key] = new_obj[key].__dict__

if type(new_obj[key]) ==dict:
if type(new_obj[key]) is dict:

l_values = [node.nodeName for node in xml.childNodes]
l_values.sort()
Expand All @@ -200,7 +200,7 @@ def func_get_doc_to_xml(obj, xml):

xml = append_text_child(xmld, xml, key, "")

if type(new_obj[key]) == list:
if type(new_obj[key]) is list:
if key == 'references':
xml = append_text_child(xmld, xml, 'references', "")
xml = append_text_child(xmld, xml.lastChild, 'reference', "")
Expand Down

0 comments on commit b1c1941

Please sign in to comment.