From 91bb93d26647260da8f52035e73e49d647039801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Sat, 31 Oct 2015 16:57:20 +0100 Subject: [PATCH] Fix create_blob_fromiobase with pypy The file object is passed to us, so we never incremented its refcount. We shouldn't decrement it on exit. --- src/repository.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/repository.c b/src/repository.c index 1fa6a72..0d96930 100644 --- a/src/repository.c +++ b/src/repository.c @@ -881,7 +881,6 @@ Repository_create_blob_fromiobase(Repository *self, PyObject *py_file) py_is_readable = PyObject_CallMethod(py_file, "readable", NULL); if (!py_is_readable) { - Py_DECREF(py_file); if (PyErr_ExceptionMatches(PyExc_AttributeError)) PyErr_SetObject(PyExc_TypeError, py_file); return NULL; @@ -898,8 +897,6 @@ Repository_create_blob_fromiobase(Repository *self, PyObject *py_file) err = git_blob_create_fromchunks(&oid, self->repo, NULL, &read_chunk, py_file); - Py_DECREF(py_file); - if (err < 0) return Error_set(err);