summaryrefslogtreecommitdiff
path: root/test/lex_many_tokens.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/lex_many_tokens.py')
-rw-r--r--test/lex_many_tokens.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/lex_many_tokens.py b/test/lex_many_tokens.py
index 3558b1a..77ae12b 100644
--- a/test/lex_many_tokens.py
+++ b/test/lex_many_tokens.py
@@ -11,7 +11,10 @@ import ply.lex as lex
tokens = ["TOK%d" % i for i in range(1000)]
for tok in tokens:
- exec "t_%s = '%s:'" % (tok,tok)
+ if sys.version_info[0] < 3:
+ exec("t_%s = '%s:'" % (tok,tok))
+ else:
+ exec("t_%s = '%s:'" % (tok,tok), globals())
t_ignore = " \t"