Skip to content

Commit 11b781a

Browse files
committed
Correct exception handling for defusedxml over lxml
1 parent 4d426a4 commit 11b781a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

plugwise/smile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ async def request(
259259
try:
260260
# Encode to ensure utf8 parsing
261261
xml = etree.XML(escape_illegal_xml_characters(result).encode())
262-
except etree.XMLSyntaxError:
262+
except etree.ParseError:
263263
_LOGGER.error("Smile returns invalid XML for %s", self._endpoint)
264264
raise InvalidXMLError
265265

pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
jobs=2
66
load-plugins=pylint_strict_informational
77
persistent=no
8-
extension-pkg-whitelist=ciso8601,lxml
8+
extension-pkg-whitelist=ciso8601,defusedxml
99

1010
[BASIC]
1111
good-names=id,i,j,k,ex,Run,_,fp

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def readme():
3939
"aiohttp",
4040
"async_timeout<4.0",
4141
"crcmod",
42-
"lxml",
42+
"defusedxml",
4343
"pyserial",
4444
"pytz",
4545
"python-dateutil",

0 commit comments

Comments
 (0)