From 7597cbbb4d0363c0f2e1babbff5703be41a32d8b Mon Sep 17 00:00:00 2001 From: Sourcery AI <> Date: Sat, 30 Dec 2023 14:33:22 +0000 Subject: [PATCH] 'Refactored by Sourcery' --- pystreamapi/loaders/__xml/__xml_loader.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pystreamapi/loaders/__xml/__xml_loader.py b/pystreamapi/loaders/__xml/__xml_loader.py index 9760dc1..d693b7f 100644 --- a/pystreamapi/loaders/__xml/__xml_loader.py +++ b/pystreamapi/loaders/__xml/__xml_loader.py @@ -46,8 +46,7 @@ def __load_xml_file(file_path, encoding): """Load an XML file and convert it into a list of namedtuples.""" # skipcq: PTC-W6004 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 []