]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
refactor: replace an assert with a type: ignore
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 1 May 2022 20:44:37 +0000 (22:44 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 2 May 2022 00:07:53 +0000 (02:07 +0200)
It's not like we give away opcodes for free here.

psycopg/psycopg/cursor.py

index 2c127587d6e4c2ff74513f3b8347cd534d4b6623..ba15244cc233af16c3e130c0946826bb9bc45069 100644 (file)
@@ -579,8 +579,8 @@ class Cursor(BaseCursor["Connection[Any]", Row]):
             self._conn.wait(self._stream_send_gen(query, params, binary=binary))
             first = True
             while self._conn.wait(self._stream_fetchone_gen(first)):
-                rec = self._tx.load_row(0, self._make_row)
-                assert rec is not None
+                # We know that, if we got a result, it has a single row.
+                rec: Row = self._tx.load_row(0, self._make_row)  # type: ignore
                 yield rec
                 first = False