Skip to content

Commit

Permalink
Remove init_local_none option
Browse files Browse the repository at this point in the history
  • Loading branch information
vitek committed May 29, 2011
1 parent 990cb64 commit dd389de
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
4 changes: 0 additions & 4 deletions Cython/Compiler/Nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1506,10 +1506,6 @@ def generate_function_definitions(self, env, code):
self.getbuffer_normal_cleanup(code)
# ----- Return cleanup for both error and no-error return
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:
if entry.type.is_pyobject:
Expand Down
6 changes: 0 additions & 6 deletions Cython/Compiler/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@
# If this is 0 it simply creates a wrapper.
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
# standalone executable or calling from external libraries.
# This will provide a method which initalizes the interpreter and
Expand Down
2 changes: 1 addition & 1 deletion Cython/Compiler/Symtab.py
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,7 @@ def declare_var(self, name, type, pos,
entry = Scope.declare_var(self, name, type, pos,
cname=cname, visibility=visibility,
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.is_local = 1

Expand Down

0 comments on commit dd389de

Please sign in to comment.