diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-04-15 14:11:10 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-04-15 14:11:10 +0300 |
commit | 6fc4e9c8e178eef8e0d4607b062b056e075611c0 (patch) | |
tree | 7584d25b795418d2870a2745ca6a43c879931084 /Objects | |
parent | 2bde55ad3c25edcb6265893a8c8eee203a6a179b (diff) | |
download | cpython-6fc4e9c8e178eef8e0d4607b062b056e075611c0.tar.gz |
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 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 = { |