[Python-checkins] bpo-40958: Avoid 'possible loss of data' warning on Windows (GH-20970)

Lysandros Nikolaou webhook-mailer at python.org
Sat Jun 20 08:57:31 EDT 2020


https://github.com/python/cpython/commit/861efc6e8fe7f030b1e193989b13287b31385939
commit: 861efc6e8fe7f030b1e193989b13287b31385939
branch: master
author: Lysandros Nikolaou <lisandrosnik at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-06-20T05:57:27-07:00
summary:

bpo-40958: Avoid 'possible loss of data' warning on Windows (GH-20970)

files:
M Parser/pegen.c
M Parser/pegen.h

diff --git a/Parser/pegen.c b/Parser/pegen.c
index b374740308a36..594754cee5d53 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 43168074c3500..ef095dda49fd7 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;
 



More information about the Python-checkins mailing list