Skip to content

Commit 5ae2f46

Browse files
authored
fix: Fix a mypy failure in the generate action (#162)
The `import uvloop` line here needs to: * Ignore a pylint `import-outside-toplevel` warning * Ignore a mypy error if stubs are not present (uvloop is not a dependency, so it's not actually installed in CI) These comments were not ignoring both errors, turns out we need to flip the order.
1 parent 7fc56cb commit 5ae2f46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/unstructured_client/_hooks/custom/split_pdf_hook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async def run_tasks(coroutines: list[Coroutine], allow_failed: bool = False) ->
7676
def context_is_uvloop():
7777
"""Return true if uvloop is installed and we're currently in a uvloop context. Our asyncio splitting code currently doesn't work under uvloop."""
7878
try:
79-
import uvloop # pylint: disable=import-outside-toplevel # type: ignore
79+
import uvloop # type: ignore[import] # pylint: disable=import-outside-toplevel
8080
loop = asyncio.get_event_loop()
8181
return isinstance(loop, uvloop.Loop)
8282
except (ImportError, RuntimeError):

0 commit comments

Comments
 (0)