]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-105390: Add explicit type cast (GH-105466) (#105472)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 7 Jun 2023 22:46:24 +0000 (15:46 -0700)
committerGitHub <noreply@github.com>
Wed, 7 Jun 2023 22:46:24 +0000 (23:46 +0100)
Python/Python-tokenize.c

index 83a129c138b1740c8e76492d8609a0c17ce0aee9..2cf052a0cdeb3b860973b438a84728bc07efc89a 100644 (file)
@@ -85,7 +85,8 @@ _tokenizer_error(struct tok_state *tok)
             break;
         case E_EOF:
             PyErr_SetString(PyExc_SyntaxError, "unexpected EOF in multi-line statement");
-            PyErr_SyntaxLocationObject(tok->filename, tok->lineno, tok->inp - tok->buf < 0 ? 0 : tok->inp - tok->buf);
+            PyErr_SyntaxLocationObject(tok->filename, tok->lineno,
+                                       tok->inp - tok->buf < 0 ? 0 : (int)(tok->inp - tok->buf));
             return -1;
         case E_DEDENT:
             msg = "unindent does not match any outer indentation level";