self_arg = func_type.args[0]
if self_arg.not_none: # C methods must do the None test for self at *call* time
self.self = self.self.as_none_safe_node(
- "'NoneType' object has no attribute '%s'" % self.function.entry.name)
+ "'NoneType' object has no attribute '%s'" % self.function.entry.name,
+ 'PyExc_AttributeError')
expected_type = self_arg.type
self.coerced_self = CloneNode(self.self).coerce_to(
expected_type, env)
"""
>>> test_set_clear_None()
Traceback (most recent call last):
- TypeError: 'NoneType' object has no attribute 'clear'
+ AttributeError: 'NoneType' object has no attribute 'clear'
"""
cdef set s1 = None
s1.clear()