Commit bd8aea50 authored by Lisandro Dalcin's avatar Lisandro Dalcin

fix bugs introduced in last commit

parent 25027a8d
...@@ -301,17 +301,16 @@ class BuiltinObjectType(PyObjectType): ...@@ -301,17 +301,16 @@ class BuiltinObjectType(PyObjectType):
return type.is_pyobject and self.assignable_from(type) return type.is_pyobject and self.assignable_from(type)
def type_test_code(self, arg): def type_test_code(self, arg):
if type == 'set': type_name = self.name
type = 'AnySet' if type_name == 'str':
elif type == 'frozenset': type_name = 'String'
type = 'FrozenSet' elif type_name == 'set':
elif type == 'str': type_name = 'AnySet'
type = 'FrozenSet' elif type_name == 'frozenset':
elif type == 'str': type_name = 'FrozenSet'
type = 'String'
else: else:
type = self.name.capitalize() type_name = type_name.capitalize()
return 'likely(Py%s_CheckExact(%s)) || (%s) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected %s, got %%s", Py_TYPE(%s)->tp_name), 0)' % (type, arg, arg, self.name, arg) return 'likely(Py%s_CheckExact(%s)) || (%s) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected %s, got %%s", Py_TYPE(%s)->tp_name), 0)' % (type_name, arg, arg, self.name, arg)
def declaration_code(self, entity_code, def declaration_code(self, entity_code,
for_display = 0, dll_linkage = None, pyrex = 0): for_display = 0, dll_linkage = None, pyrex = 0):
......
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