Skip to content

Commit ebe1ee1

Browse files
Matus ValoMatus Valo
authored andcommitted
Mark functions as noexcept to ensure cython 3 compatibility
1 parent 7783f1c commit ebe1ee1

22 files changed

+48
-48
lines changed

uvloop/dns.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ cdef class AddrInfo:
298298
uv.uv_freeaddrinfo(self.data) # returns void
299299
self.data = NULL
300300

301-
cdef void set_data(self, system.addrinfo *data):
301+
cdef void set_data(self, system.addrinfo *data) noexcept:
302302
self.data = data
303303

304304
cdef unpack(self):
@@ -326,7 +326,7 @@ cdef class AddrInfo:
326326
return result
327327

328328
@staticmethod
329-
cdef int isinstance(object other):
329+
cdef int isinstance(object other) noexcept:
330330
return type(other) is AddrInfo
331331

332332

@@ -415,7 +415,7 @@ cdef _intenum_converter(value, enum_klass):
415415

416416

417417
cdef void __on_addrinfo_resolved(uv.uv_getaddrinfo_t *resolver,
418-
int status, system.addrinfo *res) with gil:
418+
int status, system.addrinfo *res) noexcept with gil:
419419

420420
if resolver.data is NULL:
421421
aio_logger.error(
@@ -446,7 +446,7 @@ cdef void __on_addrinfo_resolved(uv.uv_getaddrinfo_t *resolver,
446446
cdef void __on_nameinfo_resolved(uv.uv_getnameinfo_t* req,
447447
int status,
448448
const char* hostname,
449-
const char* service) with gil:
449+
const char* service) noexcept with gil:
450450
cdef:
451451
NameInfoRequest request = <NameInfoRequest> req.data
452452
Loop loop = request.loop

uvloop/errors.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ cdef __convert_python_error(int uverr):
5151
return exc(oserr, __strerr(oserr))
5252

5353

54-
cdef int __convert_socket_error(int uverr):
54+
cdef int __convert_socket_error(int uverr) noexcept:
5555
cdef int sock_err = 0
5656

5757
if uverr == uv.UV_EAI_ADDRFAMILY:

uvloop/handles/async_.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ cdef class UVAsync(UVHandle):
4141
return handle
4242

4343

44-
cdef void __uvasync_callback(uv.uv_async_t* handle) with gil:
44+
cdef void __uvasync_callback(uv.uv_async_t* handle) noexcept with gil:
4545
if __ensure_handle_data(<uv.uv_handle_t*>handle, "UVAsync callback") == 0:
4646
return
4747

uvloop/handles/basetransport.pxd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ cdef class UVBaseTransport(UVSocketHandle):
4747
# === overloads ===
4848

4949
cdef _new_socket(self)
50-
cdef size_t _get_write_buffer_size(self)
50+
cdef size_t _get_write_buffer_size(self) noexcept
5151

52-
cdef bint _is_reading(self)
52+
cdef bint _is_reading(self) noexcept
5353
cdef _start_reading(self)
5454
cdef _stop_reading(self)

uvloop/handles/basetransport.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ cdef class UVBaseTransport(UVSocketHandle):
1818

1919
self._closing = 0
2020

21-
cdef size_t _get_write_buffer_size(self):
21+
cdef size_t _get_write_buffer_size(self) noexcept:
2222
return 0
2323

2424
cdef inline _schedule_call_connection_made(self):
@@ -211,7 +211,7 @@ cdef class UVBaseTransport(UVSocketHandle):
211211
self._extra_info = {}
212212
self._extra_info[name] = obj
213213

214-
cdef bint _is_reading(self):
214+
cdef bint _is_reading(self) noexcept:
215215
raise NotImplementedError
216216

217217
cdef _start_reading(self):

uvloop/handles/check.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ cdef class UVCheck(UVHandle):
5757
return handle
5858

5959

60-
cdef void cb_check_callback(uv.uv_check_t* handle) with gil:
60+
cdef void cb_check_callback(uv.uv_check_t* handle) noexcept with gil:
6161
if __ensure_handle_data(<uv.uv_handle_t*>handle, "UVCheck callback") == 0:
6262
return
6363

uvloop/handles/fsevent.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ cdef class UVFSEvent(UVHandle):
9090

9191

9292
cdef void __uvfsevent_callback(uv.uv_fs_event_t* handle, const char *filename,
93-
int events, int status) with gil:
93+
int events, int status) noexcept with gil:
9494
if __ensure_handle_data(
9595
<uv.uv_handle_t*>handle, "UVFSEvent callback"
9696
) == 0:

uvloop/handles/handle.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ cdef class UVSocketHandle(UVHandle):
302302

303303

304304
cdef inline bint __ensure_handle_data(uv.uv_handle_t* handle,
305-
const char* handle_ctx):
305+
const char* handle_ctx) noexcept:
306306

307307
cdef Loop loop
308308

@@ -335,7 +335,7 @@ cdef inline bint __ensure_handle_data(uv.uv_handle_t* handle,
335335
return 1
336336

337337

338-
cdef void __uv_close_handle_cb(uv.uv_handle_t* handle) with gil:
338+
cdef void __uv_close_handle_cb(uv.uv_handle_t* handle) noexcept with gil:
339339
cdef UVHandle h
340340

341341
if handle.data is NULL:
@@ -363,14 +363,14 @@ cdef void __uv_close_handle_cb(uv.uv_handle_t* handle) with gil:
363363
Py_DECREF(h) # Was INCREFed in UVHandle._close
364364

365365

366-
cdef void __close_all_handles(Loop loop):
366+
cdef void __close_all_handles(Loop loop) noexcept:
367367
uv.uv_walk(loop.uvloop,
368368
__uv_walk_close_all_handles_cb,
369369
<void*>loop) # void
370370

371371

372372
cdef void __uv_walk_close_all_handles_cb(
373-
uv.uv_handle_t* handle, void* arg) with gil:
373+
uv.uv_handle_t* handle, void* arg) noexcept with gil:
374374

375375
cdef:
376376
Loop loop = <Loop>arg

uvloop/handles/idle.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ cdef class UVIdle(UVHandle):
5757
return handle
5858

5959

60-
cdef void cb_idle_callback(uv.uv_idle_t* handle) with gil:
60+
cdef void cb_idle_callback(uv.uv_idle_t* handle) noexcept with gil:
6161
if __ensure_handle_data(<uv.uv_handle_t*>handle, "UVIdle callback") == 0:
6262
return
6363

uvloop/handles/pipe.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ cdef class _PipeConnectRequest(UVRequest):
202202
addr,
203203
__pipe_connect_callback)
204204

205-
cdef void __pipe_connect_callback(uv.uv_connect_t* req, int status) with gil:
205+
cdef void __pipe_connect_callback(uv.uv_connect_t* req, int status) noexcept with gil:
206206
cdef:
207207
_PipeConnectRequest wrapper
208208
UnixTransport transport

0 commit comments

Comments
 (0)