Fix build with python 2.7

This commit is contained in:
Daniel Grunwald 2015-09-20 19:43:24 +02:00
parent 5bab92cbcc
commit 2b7d28f7fd
2 changed files with 5 additions and 2 deletions

View File

@ -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`):

View File

@ -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()))
}