Skip to content

Commit 76b59f8

Browse files
committed
Revert "Simplify"
This reverts commit 564f78b.
1 parent a3d20b3 commit 76b59f8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

plugwise/helper.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,13 @@
7373
)
7474

7575

76-
def _find(xml_in: etree, locator: str) -> etree:
76+
def _find(xml_in: etree, locator: str) -> etree | None:
7777
"""Helper-function for use of etree.find()."""
7878
if xml_in is not None:
79-
return xml_in.find(locator)
79+
if (found := xml_in.find(locator)) is not None:
80+
return found
81+
82+
return None
8083

8184
raise XMLDataMissingError()
8285

0 commit comments

Comments
 (0)