Small cleanup.

This commit is contained in:
Andrey Rakhmatullin 2023-08-09 23:17:32 +04:00
parent 53539483c3
commit 8050257c14
2 changed files with 2 additions and 2 deletions

View File

@ -290,7 +290,8 @@ class FTPFeedStorage(BlockingFeedStorage):
feed_options: Optional[Dict[str, Any]] = None,
):
u = urlparse(uri)
assert u.hostname
if not u.hostname:
raise ValueError(f"Got a storage URI without a hostname: {uri}")
self.host: str = u.hostname
self.port: int = int(u.port or "21")
self.username: str = u.username or ""

View File

@ -85,7 +85,6 @@ def xmliter_lxml(
reader = _StreamReader(obj)
tag = f"{{{namespace}}}{nodename}" if namespace else nodename
# technically, etree.iterparse only needs .read() AFAICS, but this is how it's typed
iterable = etree.iterparse(
cast("SupportsReadClose[bytes]", reader), tag=tag, encoding=reader.encoding
)