|
|
736726 |
From 91cc49153c2618b33c8ff36e12bb68d3ce61d3ee Mon Sep 17 00:00:00 2001
|
|
|
736726 |
From: Thomas A Caswell <tcaswell@gmail.com>
|
|
|
736726 |
Date: Sun, 10 Nov 2019 18:42:54 -0500
|
|
|
736726 |
Subject: [PATCH] FIX: build on cpython master branch
|
|
|
736726 |
|
|
|
736726 |
https://github.com/python/cpython/pull/16013
|
|
|
736726 |
https://github.com/python/cpython/commit/3a4f66707e824ef3a8384827590ebaa6ca463dc0
|
|
|
736726 |
|
|
|
736726 |
removed two arguments from _PyBytes_DecodeEscape .
|
|
|
736726 |
|
|
|
736726 |
This calls _PyBytes_DecodeEscape with the new signature if the minor
|
|
|
736726 |
version is 9 or greater.
|
|
|
736726 |
---
|
|
|
736726 |
ast3/Python/ast.c | 6 ++++++
|
|
|
736726 |
1 file changed, 6 insertions(+)
|
|
|
736726 |
|
|
|
736726 |
diff --git a/ast3/Python/ast.c b/ast3/Python/ast.c
|
|
|
736726 |
index 9082329..d772a83 100644
|
|
|
736726 |
--- a/ast3/Python/ast.c
|
|
|
736726 |
+++ b/ast3/Python/ast.c
|
|
|
736726 |
@@ -4531,8 +4531,14 @@ decode_bytes_with_escapes(struct compiling *c, const node *n, const char *s,
|
|
|
736726 |
size_t len)
|
|
|
736726 |
{
|
|
|
736726 |
const char *first_invalid_escape;
|
|
|
736726 |
+
|
|
|
736726 |
+ #if PY_MINOR_VERSION < 9
|
|
|
736726 |
PyObject *result = _PyBytes_DecodeEscape(s, len, NULL, 0, NULL,
|
|
|
736726 |
&first_invalid_escape);
|
|
|
736726 |
+ #else
|
|
|
736726 |
+ PyObject *result = _PyBytes_DecodeEscape(s, len, NULL,
|
|
|
736726 |
+ &first_invalid_escape);
|
|
|
736726 |
+ #endif
|
|
|
736726 |
if (result == NULL)
|
|
|
736726 |
return NULL;
|
|
|
736726 |
|