From 4386c5bf5fcaf1ddb7c92209a66c4f437f1f3937 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Thu, 15 Feb 2024 14:44:12 +0000 Subject: [PATCH] Fix ``_ErrorLog`` not iterable Fix the following mypy error: ``` lib/galaxy/tool_util/linters/xsd.py:28: error: "_ErrorLog" has no attribute "__iter__" (not iterable) [attr-defined] for error in xsd.error_log: ^~~~~~~~~~~~~ ``` xref: https://github.com/galaxyproject/galaxy/pull/17081/files#r1490662640 --- lxml-stubs/etree.pyi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lxml-stubs/etree.pyi b/lxml-stubs/etree.pyi index 9c399a2..a68b090 100644 --- a/lxml-stubs/etree.pyi +++ b/lxml-stubs/etree.pyi @@ -577,7 +577,12 @@ def tostring( inclusive_ns_prefixes: Any = ..., ) -> _AnyStr: ... -class _ErrorLog: ... +class _LogEntry: + path: Optional[str] + +class _ErrorLog: + def __iter__(self) -> Iterator["_LogEntry"]: ... + class Error(Exception): ... class LxmlError(Error):