Skip to content

Commit

Permalink
warning fix
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Sep 23, 2024
1 parent 2544616 commit 9fa3ac2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion source/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ PyObject *aws_py_memory_view_from_byte_buffer(struct aws_byte_buf *buf) {

PyObject *aws_py_weakref_get_ref(PyObject *object) {
PyObject *self = Py_None;
#if PY_VERSION_HEX >= 0x030D0000 /* Check if Python version is 3.13 or higher */
#if PY_VERSION_HEX >= 0x030D0000 /* Check if Python version is 3.13 or higher */
if (PyWeakref_GetRef(object, &self) < 0) { /* strong reference */
return Py_None;
}
Expand All @@ -530,6 +530,7 @@ PyObject *aws_py_weakref_get_ref(PyObject *object) {
}

PyObject *aws_py_weakref_release_ref(PyObject *object) {
(void)object;
/* Python versions before 3.13 returns a borrowed reference */
#if PY_VERSION_HEX >= 0x030D0000
Py_XDECREF(object);
Expand Down
3 changes: 2 additions & 1 deletion source/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ PyObject *aws_py_get_error_message(PyObject *self, PyObject *args);
/* Create a write-only memoryview from the remaining free space in an aws_byte_buf */
PyObject *aws_py_memory_view_from_byte_buffer(struct aws_byte_buf *buf);

/* Python 3.13+ changed the function to get a reference from WeakRef. This function is an abstraction over two different methods since we support Python versions before 3.13. */
/* Python 3.13+ changed the function to get a reference from WeakRef. This function is an abstraction over two different
* methods since we support Python versions before 3.13. */
PyObject *aws_py_weakref_get_ref(PyObject *object);
/* Release the weakwef provided by the `aws_py_weakref_get_ref`. */
PyObject *aws_py_weakref_release_ref(PyObject *object);
Expand Down

0 comments on commit 9fa3ac2

Please sign in to comment.