summaryrefslogtreecommitdiff
path: root/Parser
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-04-24 18:07:05 +0000
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-04-24 18:07:05 +0000
commitb88004d9b100a285c6cf6563a4a74796d36e8707 (patch)
tree79ea298ff6f53573d28aa760bcbe9d4456e6dc3f /Parser
parent5cbdbc3b3550ee7ae6cabe7975c6aa6bbb31fc0b (diff)
downloadcpython-b88004d9b100a285c6cf6563a4a74796d36e8707.tar.gz
Issue2681: the literal 0o8 was wrongly accepted, and evaluated as float(0.0).
This happened only when 8 is the first digit. Credits go to Lukas Meuser.
Diffstat (limited to 'Parser')
-rw-r--r--Parser/tokenizer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index 29fb114291..1d0a4aa3f2 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -1351,7 +1351,7 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end)
else if (c == 'o' || c == 'O') {
/* Octal */
c = tok_nextc(tok);
- if (c < '0' || c > '8') {
+ if (c < '0' || c >= '8') {
tok->done = E_TOKEN;
tok_backup(tok, c);
return ERRORTOKEN;