Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use Py_UNREACHABLE()
  • Loading branch information
methane committed Dec 13, 2017
commit 94160d4ac5fd44903233019b0eef680c3421b056
5 changes: 2 additions & 3 deletions Python/ast_opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,15 @@ get_const_value(expr_ty e)
case NameConstant_kind:
return e->v.NameConstant.value;
default:
assert(!is_const(e));
return NULL;
Py_UNREACHABLE();
}
}

static int
make_const(expr_ty node, PyObject *val, PyArena *arena)
{
if (val == NULL) {
if(!PyErr_ExceptionMatches(PyExc_KeyboardInterrupt))
if (!PyErr_ExceptionMatches(PyExc_KeyboardInterrupt))
PyErr_Clear();
return 1;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it return 0 in case of KeyboardInterrupt?

}
Expand Down