Commit 8c7c68b3 authored by Stefan Behnel's avatar Stefan Behnel

use unique 'objstruct_cname' instead of 'name' when sorting extension types

parent d0ac21a8
...@@ -7,7 +7,8 @@ cython.declare(Naming=object, Options=object, PyrexTypes=object, TypeSlots=objec ...@@ -7,7 +7,8 @@ cython.declare(Naming=object, Options=object, PyrexTypes=object, TypeSlots=objec
error=object, warning=object, py_object_type=object, UtilityCode=object, error=object, warning=object, py_object_type=object, UtilityCode=object,
EncodedString=object) EncodedString=object)
import os, time import os
import operator
from PyrexTypes import CPtrType from PyrexTypes import CPtrType
import Future import Future
...@@ -457,12 +458,12 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -457,12 +458,12 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
return (vtab_list, vtabslot_list) return (vtab_list, vtabslot_list)
def sort_cdef_classes(self, env): def sort_cdef_classes(self, env):
key_func = operator.attrgetter('objstruct_cname')
entry_dict = {} entry_dict = {}
for entry in env.c_class_entries: for entry in env.c_class_entries:
entry_dict[entry.name] = entry entry_dict[key_func(entry.type)] = entry
def entry_name(entry): env.c_class_entries[:] = self.sort_types_by_inheritance(
return entry.name entry_dict, key_func)
env.c_class_entries[:] = self.sort_types_by_inheritance(entry_dict, entry_name)
def generate_type_definitions(self, env, modules, vtab_list, vtabslot_list, code): def generate_type_definitions(self, env, modules, vtab_list, vtabslot_list, code):
# TODO: Why are these separated out? # TODO: Why are these separated out?
......
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