summaryrefslogtreecommitdiffstats
path: root/Lib/tokenize.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-01-19 19:27:05 (GMT)
committerGeorg Brandl <georg@python.org>2008-01-19 19:27:05 (GMT)
commit14404b68d8c5a501a2f5ee6f45494865b7b38276 (patch)
treef1db16ee7f39d81414ad24bd682e9df61b74e4dd /Lib/tokenize.py
parent2686f4d9d14e2b30a61e5350dcb4a56c43c82b57 (diff)
downloadcpython-14404b68d8c5a501a2f5ee6f45494865b7b38276.zip
cpython-14404b68d8c5a501a2f5ee6f45494865b7b38276.tar.gz
cpython-14404b68d8c5a501a2f5ee6f45494865b7b38276.tar.bz2
Fix #1679: "0x" was taken as a valid integer literal.
Fixes the tokenizer, tokenize.py and int() to reject this. Patches by Malte Helmert.
Diffstat (limited to 'Lib/tokenize.py')
-rw-r--r--Lib/tokenize.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/tokenize.py b/Lib/tokenize.py
index 9322e0f..1c93944 100644
--- a/Lib/tokenize.py
+++ b/Lib/tokenize.py
@@ -50,7 +50,7 @@ Comment = r'#[^\r\n]*'
Ignore = Whitespace + any(r'\\\r?\n' + Whitespace) + maybe(Comment)
Name = r'[a-zA-Z_]\w*'
-Hexnumber = r'0[xX][\da-fA-F]*[lL]?'
+Hexnumber = r'0[xX][\da-fA-F]+[lL]?'
Octnumber = r'0[0-7]*[lL]?'
Decnumber = r'[1-9]\d*[lL]?'
Intnumber = group(Hexnumber, Octnumber, Decnumber)