]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40958: Avoid 'possible loss of data' warning on Windows (GH-20970)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 20 Jun 2020 17:35:03 +0000 (10:35 -0700)
committerGitHub <noreply@github.com>
Sat, 20 Jun 2020 17:35:03 +0000 (10:35 -0700)
(cherry picked from commit 861efc6e8fe7f030b1e193989b13287b31385939)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Parser/pegen/pegen.c
Parser/pegen/pegen.h

index e63e5a8aed719e3244e6052451228c40afaa4d6b..a1a59ae86cafb4d1c8d723b8d8bd166e0e53b74d 100644 (file)
@@ -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) {
index e459fc5edb3a82c79b8f2f39d5b0872df9498724..1c038aba44515d138d4590852c1ffe1b01e34dc2 100644 (file)
@@ -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;