From 861efc6e8fe7f030b1e193989b13287b31385939 Mon Sep 17 00:00:00 2001 From: Lysandros Nikolaou Date: Sat, 20 Jun 2020 15:57:27 +0300 Subject: [PATCH] bpo-40958: Avoid 'possible loss of data' warning on Windows (GH-20970) --- Parser/pegen.c | 2 +- Parser/pegen.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Parser/pegen.c b/Parser/pegen.c index b374740308a..594754cee5d 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -397,7 +397,7 @@ _PyPegen_raise_error_known_location(Parser *p, PyObject *errtype, } if (p->start_rule == Py_file_input) { - error_line = PyErr_ProgramTextObject(p->tok->filename, lineno); + error_line = PyErr_ProgramTextObject(p->tok->filename, (int) lineno); } if (!error_line) { diff --git a/Parser/pegen.h b/Parser/pegen.h index 43168074c35..ef095dda49f 100644 --- a/Parser/pegen.h +++ b/Parser/pegen.h @@ -34,7 +34,7 @@ typedef struct _memo { typedef struct { int type; PyObject *bytes; - Py_ssize_t lineno, col_offset, end_lineno, end_col_offset; + int lineno, col_offset, end_lineno, end_col_offset; Memo *memo; } Token;