Commit 2c1b7967 authored by Stefan Behnel's avatar Stefan Behnel

unify None indexing exception message

parent b3048e1a
......@@ -16,7 +16,7 @@ static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void);
/////////////// RaiseNoneIndexingError ///////////////
static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable");
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
}
/////////////// RaiseNoneIterError.proto ///////////////
......
......@@ -24,7 +24,7 @@ def index_tuple(tuple t, int i):
IndexError: tuple index out of range
>>> index_tuple(None, 0)
Traceback (most recent call last):
TypeError: 'NoneType' object is unsubscriptable
TypeError: 'NoneType' object is not subscriptable
"""
return t[i]
......@@ -41,7 +41,7 @@ def index_list(list L, int i):
IndexError: list index out of range
>>> index_list(None, 0)
Traceback (most recent call last):
TypeError: 'NoneType' object is unsubscriptable
TypeError: 'NoneType' object is not subscriptable
"""
return L[i]
......@@ -65,7 +65,7 @@ def index_object(object o, int i):
IndexError: string index out of range
>>> index_object(None, 0)
Traceback (most recent call last):
TypeError: 'NoneType' object is unsubscriptable
TypeError: 'NoneType' object is not subscriptable
"""
return o[i]
......
......@@ -19,7 +19,6 @@ def getattr_(MyClass var):
2
>>> getattr_(None)
Traceback (most recent call last):
...
AttributeError: 'NoneType' object has no attribute 'a'
>>> setattr_(obj)
>>> getattr_(obj)
......@@ -34,7 +33,6 @@ def setattr_(MyClass var):
>>> setattr_(obj)
>>> setattr_(None)
Traceback (most recent call last):
...
AttributeError: 'NoneType' object has no attribute 'a'
"""
var.a = 10
......@@ -66,7 +64,6 @@ def check_and_assign(MyClass var):
>>> obj = MyClass(2, 3)
>>> check_and_assign(obj)
Traceback (most recent call last):
...
AttributeError: 'NoneType' object has no attribute 'a'
"""
if var is not None:
......@@ -79,8 +76,7 @@ def check_buffer_get(object[int] buf):
"""
>>> check_buffer_get(None)
Traceback (most recent call last):
...
TypeError: 'NoneType' object is unsubscriptable
TypeError: 'NoneType' object is not subscriptable
"""
return buf[0]
......@@ -89,7 +85,6 @@ def check_buffer_set(object[int] buf):
"""
>>> check_buffer_set(None)
Traceback (most recent call last):
...
TypeError: 'NoneType' object is unsubscriptable
TypeError: 'NoneType' object is not subscriptable
"""
buf[0] = 1
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment