Skip to content

Commit f394750

Browse files
committed
projects(imports): fix style py312 warning for xml root check
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
1 parent e43c392 commit f394750

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

rdmo/projects/imports.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,15 @@ class RDMOXMLImport(Import):
9292
'application/xml': ['.xml']
9393
}
9494

95-
def check(self):
95+
def check(self) -> bool:
9696
file_type, encoding = mimetypes.guess_type(self.file_name)
97-
if file_type == 'application/xml' or file_type == 'text/xml':
97+
if file_type in ('application/xml', 'text/xml'):
9898
self.root = read_xml_file(self.file_name)
99-
if self.root and self.root.tag == 'project':
99+
if self.root is not None and self.root.tag == 'project':
100100
self.ns_map = get_ns_map(self.root)
101101
return True
102+
return False
103+
102104

103105
def process(self):
104106
if self.current_project is None:

0 commit comments

Comments
 (0)