Skip to content

Commit 509e0ea

Browse files
authored
Merge pull request #1270 from rdmorganiser/2.3.0-fixes-fix-style-warning-projects-imports-check
projects(imports): fix style py312 warning for xml root check
2 parents f4b4a2d + f394750 commit 509e0ea

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)