Skip to content

Commit

Permalink
python2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Jan 19, 2018
1 parent b738c1a commit 3681cf5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Changes
-------

0.2.4 (2018-01-19)
^^^^^^^^^^^^^^^^^^

* Allow to get mutable ref from PyObject #106

Expand Down
2 changes: 2 additions & 0 deletions src/class/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ impl<T> PyBufferProtocolImpl for T {
impl<'p, T> PyBufferProtocolImpl for T where T: PyBufferProtocol<'p>
{
#[inline]
#[cfg_attr(feature = "cargo-clippy", allow(needless_update))]
fn tp_as_buffer() -> Option<ffi::PyBufferProcs> {
Some(ffi::PyBufferProcs{
bf_getbuffer: Self::cb_bf_getbuffer(),
bf_releasebuffer: None,
.. ffi::PyBufferProcs_INIT
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ impl<'p> Python<'p> {
/// Release `ffi::PyObject` pointer.
/// Undefined behavior if the pointer is invalid.
#[inline]
#[cfg_attr(feature = "cargo-clippy", allow(not_unsafe_ptr_arg_deref))]
#[cfg_attr(feature = "cargo-clippy", allow(not_unsafe_ptr_arg_deref))]
pub fn xdecref(self, ptr: *mut ffi::PyObject) {
if !ptr.is_null() {
unsafe {ffi::Py_DECREF(ptr)};
Expand Down

0 comments on commit 3681cf5

Please sign in to comment.