summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 9e5e3b4..b850559 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1989,9 +1989,9 @@ PyObject *unicodeescape_string(const Py_UNICODE *s,
while (size-- > 0) {
Py_UNICODE ch = *s++;
- /* Escape quotes */
- if (quotes &&
- (ch == (Py_UNICODE) PyString_AS_STRING(repr)[1] || ch == '\\')) {
+ /* Escape quotes and backslashes */
+ if ((quotes &&
+ ch == (Py_UNICODE) PyString_AS_STRING(repr)[1]) || ch == '\\') {
*p++ = '\\';
*p++ = (char) ch;
continue;