aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-07-10 12:37:30 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2016-07-10 12:37:30 +0300
commitf9efb8b18b689ff5ef7f12e6124f21532d799516 (patch)
tree17ae9815406dabe43fd8dc28c0869a1f8038d14b /Objects/bytes_methods.c
parentIssue #27442: Expose the Android API level in sysconfig.get_config_vars() (diff)
downloadcpython-f9efb8b18b689ff5ef7f12e6124f21532d799516.tar.gz
cpython-f9efb8b18b689ff5ef7f12e6124f21532d799516.tar.bz2
cpython-f9efb8b18b689ff5ef7f12e6124f21532d799516.zip
Issue #27474: Unified error messages in the __contains__ method of bytes and
bytearray for integers in and out of the Py_ssize_t range. Patch by Xiang Zhang.
Diffstat (limited to 'Objects/bytes_methods.c')
-rw-r--r--Objects/bytes_methods.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/bytes_methods.c b/Objects/bytes_methods.c
index d0f784ecd46..d7f061bcf09 100644
--- a/Objects/bytes_methods.c
+++ b/Objects/bytes_methods.c
@@ -645,7 +645,7 @@ _Py_bytes_count(const char *str, Py_ssize_t len, PyObject *args)
int
_Py_bytes_contains(const char *str, Py_ssize_t len, PyObject *arg)
{
- Py_ssize_t ival = PyNumber_AsSsize_t(arg, PyExc_ValueError);
+ Py_ssize_t ival = PyNumber_AsSsize_t(arg, NULL);
if (ival == -1 && PyErr_Occurred()) {
Py_buffer varg;
Py_ssize_t pos;