| 1 | Add a check in FlattenBuiltinTypeCreation._find_handler() to make sure that |
|---|
| 2 | function.name exists. |
|---|
| 3 | |
|---|
| 4 | diff -r c1b135a099d1 Cython/Compiler/Optimize.py |
|---|
| 5 | --- a/Cython/Compiler/Optimize.py Mon Dec 15 08:44:59 2008 -0800 |
|---|
| 6 | +++ b/Cython/Compiler/Optimize.py Mon Dec 15 09:06:04 2008 -0800 |
|---|
| 7 | @@ -370,9 +370,12 @@ |
|---|
| 8 | def _find_handler(self, call_type, function): |
|---|
| 9 | if not function.type.is_builtin_type: |
|---|
| 10 | return None |
|---|
| 11 | - handler = getattr(self, '_handle_%s_%s' % (call_type, function.name), None) |
|---|
| 12 | + name = getattr(function, 'name', None) |
|---|
| 13 | + if name is None: |
|---|
| 14 | + return None |
|---|
| 15 | + handler = getattr(self, '_handle_%s_%s' % (call_type, name), None) |
|---|
| 16 | if handler is None: |
|---|
| 17 | - handler = getattr(self, '_handle_any_%s' % function.name, None) |
|---|
| 18 | + handler = getattr(self, '_handle_any_%s' % name, None) |
|---|
| 19 | return handler |
|---|
| 20 | |
|---|
| 21 | def _handle_general_dict(self, node, pos_args, kwargs): |
|---|