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 782b541 commit 757d7ac
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pystreamapi/loaders/__xml/__xml_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ 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 src:
if src := xmlfile.read():
return __parse_xml_string(src)
return []

Expand Down

0 comments on commit 757d7ac

Please sign in to comment.