summaryrefslogtreecommitdiffstats
path: root/Objects/stringlib
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/stringlib')
-rw-r--r--Objects/stringlib/codecs.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/stringlib/codecs.h b/Objects/stringlib/codecs.h
index 749e765..a9d0a34 100644
--- a/Objects/stringlib/codecs.h
+++ b/Objects/stringlib/codecs.h
@@ -314,8 +314,9 @@ STRINGLIB(utf8_encoder)(PyObject *unicode,
else if (Py_UNICODE_IS_SURROGATE(ch)) {
Py_ssize_t startpos, endpos, newpos;
Py_ssize_t k;
- if (error_handler == _Py_ERROR_UNKNOWN)
+ if (error_handler == _Py_ERROR_UNKNOWN) {
error_handler = get_error_handler(errors);
+ }
startpos = i-1;
endpos = startpos+1;