Permalink
Browse files

Fix bugs in PyColorize

  • Loading branch information...
1 parent 6c940b7 commit 974068c07f0096a361e0898a946de7036930327a @takluyver committed Aug 14, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 IPython/utils/PyColorize.py
View
10 IPython/utils/PyColorize.py
@@ -184,11 +184,11 @@ def format2(self, raw, out = None, scheme = ''):
error = False
try:
- for token in generate_tokens(text.readline):
- self(*token)
- except tokenize.TokenError, ex:
- msg = ex[0]
- line = ex[1][0]
+ for atoken in generate_tokens(text.readline):
+ self(*atoken)
+ except tokenize.TokenError as ex:
+ msg = ex.args[0]
+ line = ex.args[1][0]
self.out.write("%s\n\n*** ERROR: %s%s%s\n" %
(colors[token.ERRORTOKEN],
msg, self.raw[self.lines[line]:],

0 comments on commit 974068c

Please sign in to comment.