diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d0db3e2..e61b8c3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,7 @@ jobs: if [ "${{ matrix.extension }}" = "skip_cython" ]; then SKIP_CYTHON=1 poetry install --only=main,dev else - poetry install --only=main,dev + REQUIRE_CYTHON=1 poetry install --only=main,dev fi - name: Test with Pytest run: export $(dbus-launch); poetry run pytest --cov-report=xml --timeout=5 diff --git a/src/dbus_fast/_private/unmarshaller.pxd b/src/dbus_fast/_private/unmarshaller.pxd index 120db911..a9e0f6c0 100644 --- a/src/dbus_fast/_private/unmarshaller.pxd +++ b/src/dbus_fast/_private/unmarshaller.pxd @@ -123,6 +123,7 @@ cdef class Unmarshaller: @cython.locals( msg=cython.bytes, + recv=cython.tuple ) cdef bytes _read_sock(self, object length) diff --git a/src/dbus_fast/_private/unmarshaller.py b/src/dbus_fast/_private/unmarshaller.py index ab330906..f6fec1b0 100644 --- a/src/dbus_fast/_private/unmarshaller.py +++ b/src/dbus_fast/_private/unmarshaller.py @@ -250,13 +250,16 @@ def _read_sock(self, length: int) -> bytes: from the read itself""" # This will raise BlockingIOError if there is no data to read # which we store in the MARSHALL_STREAM_END_ERROR object - msg, ancdata, _flags, _addr = self._sock.recvmsg(length, UNIX_FDS_CMSG_LENGTH) # type: ignore[union-attr] - for level, type_, data in ancdata: - if not (level == SOL_SOCKET and type_ == SCM_RIGHTS): - continue - self._unix_fds.extend( - ARRAY("i", data[: len(data) - (len(data) % MAX_UNIX_FDS_SIZE)]) - ) + recv = self._sock.recvmsg(length, UNIX_FDS_CMSG_LENGTH) # type: ignore[union-attr] + msg = recv[0] + ancdata = recv[1] + if ancdata: + for level, type_, data in ancdata: + if not (level == SOL_SOCKET and type_ == SCM_RIGHTS): + continue + self._unix_fds.extend( + ARRAY("i", data[: len(data) - (len(data) % MAX_UNIX_FDS_SIZE)]) + ) return msg