Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI committed Dec 30, 2023
1 parent 8ffaaa9 commit c82fc42
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pystreamapi/loaders/__xml/__xml_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def xml(src: str, read_from_src=False, retrieve_children=True, cast_types=True,
def __load_xml_file(file_path, encoding):
"""Load an XML file and convert it into a list of namedtuples."""
with open(file_path, mode='r', encoding=encoding) as xmlfile:
src = xmlfile.read()
if not src:
if src := xmlfile.read():
data = __parse_xml_string(src)
else:
return []
data = __parse_xml_string(src)
return data


Expand Down

0 comments on commit c82fc42

Please sign in to comment.