diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-04-15 11:11:10 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-04-15 11:11:10 (GMT) |
commit | c9a59e6e4f221f492578a03546e3d7c96b9da1b8 (patch) | |
tree | 4cd902442b1227032da75c8e9f7ea68090026200 /Objects | |
parent | cda80940ed444d01beed797dcd86c207f11104bc (diff) | |
download | cpython-c9a59e6e4f221f492578a03546e3d7c96b9da1b8.zip cpython-c9a59e6e4f221f492578a03546e3d7c96b9da1b8.tar.gz cpython-c9a59e6e4f221f492578a03546e3d7c96b9da1b8.tar.bz2 |
Issue #26764: Fixed SystemError in bytes.__rmod__.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/bytesobject.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index b935375..ec03233 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 = { |