Commit ab5c7f03 authored by Stefan Behnel's avatar Stefan Behnel

minor code cleanup

parent 005f99c1
...@@ -1870,16 +1870,15 @@ class FuncDefNode(StatNode, BlockNode): ...@@ -1870,16 +1870,15 @@ class FuncDefNode(StatNode, BlockNode):
code.putln("}") code.putln("}")
def get_preprocessor_guard(self): def get_preprocessor_guard(self):
is_buffer_slot = ((self.entry.name == "__getbuffer__" and entry = self.entry
self.entry.scope.is_c_class_scope) or is_buffer_slot = (entry.name in ("__getbuffer__", "__releasebuffer__") and
(self.entry.name == "__releasebuffer__" and entry.scope.is_c_class_scope)
self.entry.scope.is_c_class_scope)) if entry.is_special and not is_buffer_slot:
if self.entry.is_special and not is_buffer_slot: slot = TypeSlots.method_name_to_slot.get(entry.name)
slot = TypeSlots.method_name_to_slot.get(self.entry.name)
if slot: if slot:
preprocessor_guard = slot.preprocessor_guard_code() preprocessor_guard = slot.preprocessor_guard_code()
if (self.entry.name == '__long__' and if (entry.name == '__long__' and
not self.entry.scope.lookup_here('__int__')): not entry.scope.lookup_here('__int__')):
preprocessor_guard = None preprocessor_guard = None
return preprocessor_guard return preprocessor_guard
......
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