Add a --dump-bytes option, useful for reproducing problems from users computers

This commit is contained in:
Kovid Goyal
2017-04-05 00:13:31 +05:30
parent 15c4b1961e
commit c504b96b60
3 changed files with 16 additions and 1 deletions
+5
View File
@@ -753,6 +753,11 @@ FNAME(read_bytes)(PyObject UNUSED *self, PyObject *args) {
/* PyObject_Print(Py_BuildValue("y#", screen->read_buf, len), stderr, 0); */
break;
}
#ifdef DUMP_COMMANDS
if (len > 0) {
Py_XDECREF(PyObject_CallFunction(dump_callback, "sy#", "bytes", screen->read_buf, len)); PyErr_Clear();
}
#endif
_parse_bytes(screen, screen->read_buf, len, dump_callback);
if(len > 0) { Py_RETURN_TRUE; }
Py_RETURN_FALSE;