Fix #1679: "0x" was taken as a valid integer literal.
Fixes the tokenizer, tokenize.py and int() to reject this.
Patches by Malte Helmert.
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index 0015dae..0aaec19 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -1332,7 +1332,14 @@
goto imaginary;
#endif
if (c == 'x' || c == 'X') {
+
/* Hex */
+ c = tok_nextc(tok);
+ if (!isxdigit(c)) {
+ tok->done = E_TOKEN;
+ tok_backup(tok, c);
+ return ERRORTOKEN;
+ }
do {
c = tok_nextc(tok);
} while (isxdigit(c));