mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-21 22:54:45 +00:00
Add debugging for charset encoding parameter setting.
This commit is contained in:
parent
3f7057ce78
commit
689ab9f073
2 changed files with 18 additions and 0 deletions
|
|
@ -2408,6 +2408,15 @@ static int parser_setencoding (parser_object* self, PyObject* value, void* closu
|
|||
Py_DECREF(self->encoding);
|
||||
Py_INCREF(value);
|
||||
self->encoding = value;
|
||||
if (yydebug > 0) {
|
||||
/* print debug message */
|
||||
PyObject* repr = PyObject_Repr(value);
|
||||
if (repr == NULL) {
|
||||
return -1;
|
||||
}
|
||||
fprintf(stderr, "htmlsax: set encoding to %s\n", PyString_AsString(repr));
|
||||
Py_DECREF(repr);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -828,6 +828,15 @@ static int parser_setencoding (parser_object* self, PyObject* value, void* closu
|
|||
Py_DECREF(self->encoding);
|
||||
Py_INCREF(value);
|
||||
self->encoding = value;
|
||||
if (yydebug > 0) {
|
||||
/* print debug message */
|
||||
PyObject* repr = PyObject_Repr(value);
|
||||
if (repr == NULL) {
|
||||
return -1;
|
||||
}
|
||||
fprintf(stderr, "htmlsax: set encoding to %s\n", PyString_AsString(repr));
|
||||
Py_DECREF(repr);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue