Skip to content

Commit

Permalink
undo unintended revert
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Jul 9, 2024
1 parent b928474 commit f3b0886
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,10 @@ impl<T> Py<T> {
/// ```
#[inline]
pub fn clone_ref(&self, py: Python<'_>) -> Py<T> {
unsafe { Py::from_borrowed_ptr(py, self.0.as_ptr()) }
unsafe {
ffi::Py_INCREF(self.as_ptr());
Self::from_non_null(self.0)
}
}

/// Drops `self` and immediately decreases its reference count.
Expand Down

0 comments on commit f3b0886

Please sign in to comment.