diff --git a/src/urh/dev/native/lib/airspy.pyx b/src/urh/dev/native/lib/airspy.pyx index 080b036e3..ee2cf43f4 100644 --- a/src/urh/dev/native/lib/airspy.pyx +++ b/src/urh/dev/native/lib/airspy.pyx @@ -17,7 +17,7 @@ ctypedef unsigned long long uint64_t cdef cairspy.airspy_device* _c_device cdef object f -cdef int _c_callback_recv(cairspy.airspy_transfer*transfer) with gil: +cdef int _c_callback_recv(cairspy.airspy_transfer*transfer) noexcept with gil: global f try: ( f)(transfer.samples) diff --git a/src/urh/dev/native/lib/hackrf.pyx b/src/urh/dev/native/lib/hackrf.pyx index 5dad22456..dbe4f9a74 100644 --- a/src/urh/dev/native/lib/hackrf.pyx +++ b/src/urh/dev/native/lib/hackrf.pyx @@ -10,7 +10,7 @@ TIMEOUT = 0.2 cdef object f cdef int RUNNING = 0 -cdef int _c_callback_recv(chackrf.hackrf_transfer*transfer) with gil: +cdef int _c_callback_recv(chackrf.hackrf_transfer*transfer) noexcept with gil: global f, RUNNING try: ( f)(transfer.buffer[0:transfer.valid_length]) @@ -19,7 +19,7 @@ cdef int _c_callback_recv(chackrf.hackrf_transfer*transfer) with gil: logger.error("Cython-HackRF:" + str(e)) return -1 -cdef int _c_callback_send(chackrf.hackrf_transfer*transfer) with gil: +cdef int _c_callback_send(chackrf.hackrf_transfer*transfer) noexcept with gil: global f, RUNNING # tostring() is a compatibility (numpy<1.9) alias for tobytes(). Despite its name it returns bytes not strings. cdef unsigned int i diff --git a/src/urh/dev/native/lib/rtlsdr.pyx b/src/urh/dev/native/lib/rtlsdr.pyx index c1ea1ad46..065300d9d 100644 --- a/src/urh/dev/native/lib/rtlsdr.pyx +++ b/src/urh/dev/native/lib/rtlsdr.pyx @@ -8,7 +8,7 @@ ctypedef unsigned long long uint64_t cdef crtlsdr.rtlsdr_dev_t*_c_device -cdef void _c_callback_recv(unsigned char *buffer, uint32_t length, void *ctx): +cdef void _c_callback_recv(unsigned char *buffer, uint32_t length, void *ctx) noexcept: global f conn = ctx (f)(buffer[0:length]) @@ -339,4 +339,4 @@ cpdef int set_bias_tee(int on): return -1 if device is not initialized. 0 otherwise. """ - return crtlsdr.rtlsdr_set_bias_tee (_c_device, on) \ No newline at end of file + return crtlsdr.rtlsdr_set_bias_tee (_c_device, on)