for entry in cpp_class_attrs:
code.putln("new((void*)&(p->%s)) %s();" %
- (entry.cname, entry.type.declaration_code("")));
+ (entry.cname, entry.type.declaration_code("")))
for entry in py_attrs:
if scope.is_internal or entry.name == "__weakref__":
code.putln(
"if (%s(%s) < 0) {" %
(new_func_entry.func_cname, cinit_args))
- code.put_decref_clear("o", py_object_type, nanny=False);
+ code.put_decref_clear("o", py_object_type, nanny=False)
code.putln(
"}")
code.putln(
# We must mark ths object as (gc) untracked while tearing it down, lest
# the garbage collection is invoked while running this destructor.
if scope.needs_gc():
- code.putln("PyObject_GC_UnTrack(o);");
+ code.putln("PyObject_GC_UnTrack(o);")
# call the user's __dealloc__
self.generate_usr_dealloc_call(scope, code)
# The base class deallocator probably expects this to be tracked, so
# undo the untracking above.
if scope.needs_gc():
- code.putln("PyObject_GC_Track(o);");
+ code.putln("PyObject_GC_Track(o);")
if base_type:
tp_dealloc = TypeSlots.get_base_slot_function(scope, tp_slot)
env.use_utility_code(UtilityCode.load("CheckBinaryVersion", "ModuleSetupCode.c"))
code.putln("if ( __Pyx_check_binary_version() < 0) %s" % code.error_goto(self.pos))
- code.putln("%s = PyTuple_New(0); %s" % (Naming.empty_tuple, code.error_goto_if_null(Naming.empty_tuple, self.pos)));
- code.putln("%s = PyBytes_FromStringAndSize(\"\", 0); %s" % (Naming.empty_bytes, code.error_goto_if_null(Naming.empty_bytes, self.pos)));
+ code.putln("%s = PyTuple_New(0); %s" % (Naming.empty_tuple, code.error_goto_if_null(Naming.empty_tuple, self.pos)))
+ code.putln("%s = PyBytes_FromStringAndSize(\"\", 0); %s" % (Naming.empty_bytes, code.error_goto_if_null(Naming.empty_bytes, self.pos)))
code.putln("#ifdef __Pyx_CyFunction_USED")
code.putln("if (__Pyx_CyFunction_init() < 0) %s" % code.error_goto(self.pos))