Skip to content

Commit 99f7b0f

Browse files
committed
Expose uv_version() for libuv API compatibility
1 parent 74d381e commit 99f7b0f

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

tests/test_pointers.py

+4
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ def test_get_uv_loop_t_ptr(self):
1616

1717
self.assertTrue(cython_helper.capsule_equals(cap1, cap2))
1818
self.assertFalse(cython_helper.capsule_equals(cap1, cap3))
19+
20+
def test_get_uv_version(self):
21+
from uvloop.loop import get_uv_version
22+
self.assertGreater(get_uv_version(), 0)

uvloop/includes/uv.pxd

+2
Original file line numberDiff line numberDiff line change
@@ -501,3 +501,5 @@ cdef extern from "uv.h" nogil:
501501
const uv_process_options_t* options)
502502

503503
int uv_process_kill(uv_process_t* handle, int signum)
504+
505+
unsigned int uv_version()

uvloop/loop.pyx

+4
Original file line numberDiff line numberDiff line change
@@ -3231,6 +3231,10 @@ cdef class Loop:
32313231
return PyCapsule_New(<void *>self.uvloop, NULL, NULL)
32323232

32333233

3234+
def get_uv_version(self):
3235+
return uv.uv_version()
3236+
3237+
32343238
cdef void __loop_alloc_buffer(uv.uv_handle_t* uvhandle,
32353239
size_t suggested_size,
32363240
uv.uv_buf_t* buf) with gil:

0 commit comments

Comments
 (0)