mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
don't swallow Python errors in tree iteration
Summary: During the sequence of events that led up to S169085 we tried an hg push that resulted in an error that looked like this: "RuntimeError: std::exception". I believe that error was caused by an uncaught pyexception, replacing Python's current thread exception with a useless one. Catch the pyexception and deal with it appropriately. Reviewed By: quark-zju Differential Revision: D13112735 fbshipit-source-id: 301d899543ae95084b890c19b00322e69ded07b2
This commit is contained in:
parent
38cc6a356c
commit
e62d26feae
@ -298,6 +298,8 @@ static PyObject* newtreeiter_iternext(py_newtreeiter* self) {
|
||||
p2Node,
|
||||
(Py_ssize_t)BIN_NODE_SIZE);
|
||||
}
|
||||
} catch (const pyexception&) {
|
||||
return NULL;
|
||||
} catch (const std::exception& ex) {
|
||||
PyErr_SetString(PyExc_RuntimeError, ex.what());
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user