Issue #8767: Restore building with --disable-unicode.
Original patch by Stefano Taschini.
diff --git a/Python/peephole.c b/Python/peephole.c
index 433fe27..7521b9c 100644
--- a/Python/peephole.c
+++ b/Python/peephole.c
@@ -135,6 +135,7 @@
will return a surrogate. In both the cases skip the
optimization in order to produce compatible pycs.
*/
+#ifdef Py_USING_UNICODE
if (newconst != NULL &&
PyUnicode_Check(v) && PyUnicode_Check(newconst)) {
Py_UNICODE ch = PyUnicode_AS_UNICODE(newconst)[0];
@@ -147,6 +148,7 @@
return 0;
}
}
+#endif
break;
case BINARY_LSHIFT:
newconst = PyNumber_Lshift(v, w);