Commit 01fb1ac9 authored by Mark Florisson's avatar Mark Florisson

Fetch and restore error for Cython locals dict building

parent 8d715668
...@@ -1200,8 +1200,9 @@ class CyExec(CythonCommand, libpython.PyExec): ...@@ -1200,8 +1200,9 @@ class CyExec(CythonCommand, libpython.PyExec):
expr, input_type = self.readcode(expr) expr, input_type = self.readcode(expr)
executor = libpython.PythonCodeExecutor() executor = libpython.PythonCodeExecutor()
# get the dict of Cython globals and construct a dict in the inferior with libpython.FetchAndRestoreError():
# with Cython locals # get the dict of Cython globals and construct a dict in the
# inferior with Cython locals
global_dict = gdb.parse_and_eval( global_dict = gdb.parse_and_eval(
'(PyObject *) PyModule_GetDict(__pyx_m)') '(PyObject *) PyModule_GetDict(__pyx_m)')
local_dict = gdb.parse_and_eval('(PyObject *) PyDict_New()') local_dict = gdb.parse_and_eval('(PyObject *) PyDict_New()')
...@@ -1209,7 +1210,8 @@ class CyExec(CythonCommand, libpython.PyExec): ...@@ -1209,7 +1210,8 @@ class CyExec(CythonCommand, libpython.PyExec):
cython_function = self.get_cython_function() cython_function = self.get_cython_function()
try: try:
self._fill_locals_dict(executor, libpython.pointervalue(local_dict)) self._fill_locals_dict(executor,
libpython.pointervalue(local_dict))
executor.evalcode(expr, input_type, global_dict, local_dict) executor.evalcode(expr, input_type, global_dict, local_dict)
finally: finally:
executor.decref(libpython.pointervalue(local_dict)) executor.decref(libpython.pointervalue(local_dict))
......
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