Backport fix of #1752175.
diff --git a/Python/ast.c b/Python/ast.c
index 2a27b64..c96c503 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -3115,6 +3115,7 @@
 #endif
 }
 
+#ifdef Py_USING_UNICODE
 static PyObject *
 decode_unicode(const char *s, size_t len, int rawmode, const char *encoding)
 {
@@ -3176,6 +3177,7 @@
 	Py_XDECREF(u);
 	return v;
 }
+#endif
 
 /* s is a Python string literal, including the bracketing quote characters,
  * and r &/or u prefixes (if any), and embedded escape sequences (if any).