Commit dd389de8 authored by Vitja Makarov's avatar Vitja Makarov

Remove init_local_none option

parent 990cb64b
...@@ -1506,10 +1506,6 @@ class FuncDefNode(StatNode, BlockNode): ...@@ -1506,10 +1506,6 @@ class FuncDefNode(StatNode, BlockNode):
self.getbuffer_normal_cleanup(code) self.getbuffer_normal_cleanup(code)
# ----- Return cleanup for both error and no-error return # ----- Return cleanup for both error and no-error return
code.put_label(code.return_from_error_cleanup_label) code.put_label(code.return_from_error_cleanup_label)
if not Options.init_local_none:
for entry in lenv.var_entries:
if lenv.control_flow.get_state((entry.name, 'initialized')) is not True:
entry.xdecref_cleanup = 1
for entry in lenv.var_entries: for entry in lenv.var_entries:
if entry.type.is_pyobject: if entry.type.is_pyobject:
......
...@@ -49,12 +49,6 @@ convert_range = True ...@@ -49,12 +49,6 @@ convert_range = True
# If this is 0 it simply creates a wrapper. # If this is 0 it simply creates a wrapper.
lookup_module_cpdef = False lookup_module_cpdef = False
# This will set local variables to None rather than NULL which may cause
# surpress what would be an UnboundLocalError in pure Python but eliminates
# checking for NULL on every use, and can decref rather than xdecref at the end.
# WARNING: This is a work in progress, may currently segfault.
init_local_none = True
# Whether or not to embed the Python interpreter, for use in making a # Whether or not to embed the Python interpreter, for use in making a
# standalone executable or calling from external libraries. # standalone executable or calling from external libraries.
# This will provide a method which initalizes the interpreter and # This will provide a method which initalizes the interpreter and
......
...@@ -1386,7 +1386,7 @@ class LocalScope(Scope): ...@@ -1386,7 +1386,7 @@ class LocalScope(Scope):
entry = Scope.declare_var(self, name, type, pos, entry = Scope.declare_var(self, name, type, pos,
cname=cname, visibility=visibility, cname=cname, visibility=visibility,
api=api, in_pxd=in_pxd, is_cdef=is_cdef) api=api, in_pxd=in_pxd, is_cdef=is_cdef)
if type.is_pyobject and not Options.init_local_none: if type.is_pyobject:
entry.init = "0" entry.init = "0"
entry.is_local = 1 entry.is_local = 1
......
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