[Python-checkins] Use Py_ssize_t for the column number in the PEG support code (GH-20341)

Pablo Galindo webhook-mailer at python.org
Sun May 24 01:01:42 EDT 2020


https://github.com/python/cpython/commit/b23d7adfdfa66dd8e6f98e968b1ba885692b67d6
commit: b23d7adfdfa66dd8e6f98e968b1ba885692b67d6
branch: master
author: Pablo Galindo <Pablogsal at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-05-24T06:01:34+01:00
summary:

Use Py_ssize_t for the column number in the PEG support code (GH-20341)

files:
M Parser/pegen/pegen.c

diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c
index f1e3f9efb2f6b..9cade2a476de3 100644
--- a/Parser/pegen/pegen.c
+++ b/Parser/pegen/pegen.c
@@ -408,7 +408,7 @@ _PyPegen_raise_error_known_location(Parser *p, PyObject *errtype,
         }
     }
 
-    int col_number = byte_offset_to_character_offset(error_line, col_offset);
+    Py_ssize_t col_number = byte_offset_to_character_offset(error_line, col_offset);
 
     tmp = Py_BuildValue("(OiiN)", p->tok->filename, lineno, col_number, error_line);
     if (!tmp) {



More information about the Python-checkins mailing list