summaryrefslogtreecommitdiffstats
path: root/Lib/tokenize.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/tokenize.py')
-rw-r--r--Lib/tokenize.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/tokenize.py b/Lib/tokenize.py
index 1383f21..a225211 100644
--- a/Lib/tokenize.py
+++ b/Lib/tokenize.py
@@ -76,7 +76,10 @@ endprogs = {"'": re.compile(Single), '"': re.compile(Double),
"R'''": single3prog, 'R"""': double3prog, 'r': None, 'R': None}
tabsize = 8
-TokenError = 'TokenError'
+
+class TokenError(Exception):
+ pass
+
def printtoken(type, token, (srow, scol), (erow, ecol), line): # for testing
print "%d,%d-%d,%d:\t%s\t%s" % \
(srow, scol, erow, ecol, tok_name[type], repr(token))