From c9a59e6e4f221f492578a03546e3d7c96b9da1b8 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 15 Apr 2016 14:11:10 +0300 Subject: Issue #26764: Fixed SystemError in bytes.__rmod__. --- Objects/bytesobject.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'Objects') diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index b935375e23..ec03233ba3 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -3282,15 +3282,13 @@ bytes_methods[] = { }; static PyObject * -bytes_mod(PyObject *self, PyObject *args) +bytes_mod(PyObject *self, PyObject *arg) { - if (self == NULL || !PyBytes_Check(self)) { - PyErr_BadInternalCall(); - return NULL; + if (!PyBytes_Check(self)) { + Py_RETURN_NOTIMPLEMENTED; } - return _PyBytes_FormatEx(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), - args, 0); + arg, 0); } static PyNumberMethods bytes_as_number = { -- cgit v1.2.1