Fix build with python 2.7
This commit is contained in:
parent
5bab92cbcc
commit
2b7d28f7fd
|
@ -17,6 +17,9 @@ Supported Python versions:
|
|||
* Python 3.3
|
||||
* Python 3.4
|
||||
|
||||
Supported Rust version:
|
||||
* Rust nightly only :(
|
||||
|
||||
# Usage
|
||||
|
||||
[`cpython` is available on crates.io](https://crates.io/crates/cpython) so you can use it like this (in your `Cargo.toml`):
|
||||
|
|
|
@ -79,7 +79,7 @@ pub trait ObjectProtocol<'p> : PythonObject<'p> {
|
|||
let py = self.python();
|
||||
other.with_borrowed_ptr(py, |other| unsafe {
|
||||
let mut result : libc::c_int = -1;
|
||||
try!(error_on_minusone(py,
|
||||
try!(err::error_on_minusone(py,
|
||||
ffi::PyObject_Cmp(self.as_ptr(), other, &mut result)));
|
||||
Ok(if result < 0 {
|
||||
Ordering::Less
|
||||
|
@ -113,7 +113,7 @@ pub trait ObjectProtocol<'p> : PythonObject<'p> {
|
|||
/// This is equivalent to the Python expression 'unistr(self)'.
|
||||
#[inline]
|
||||
#[cfg(feature="python27-sys")]
|
||||
fn unistr(&self) -> PyResult<'p, PyUnicode<'p>> {
|
||||
fn unistr(&self) -> PyResult<'p, ::objects::PyUnicode<'p>> {
|
||||
unsafe {
|
||||
err::result_cast_from_owned_ptr(self.python(), ffi::PyObject_Unicode(self.as_ptr()))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue