##// END OF EJS Templates
- Fix state handling bug in format(). Closes #146.
jdh2358 -
Show More
@@ -28,7 +28,7 b''
28 scan Python source code and re-emit it with no changes to its original
28 scan Python source code and re-emit it with no changes to its original
29 formatting (which is the hard part).
29 formatting (which is the hard part).
30
30
31 $Id: PyColorize.py 2225 2007-04-08 02:48:16Z jdh2358 $"""
31 $Id: PyColorize.py 2274 2007-04-26 14:41:43Z jdh2358 $"""
32
32
33 __all__ = ['ANSICodeColors','Parser']
33 __all__ = ['ANSICodeColors','Parser']
34
34
@@ -133,7 +133,12 b' class Parser:'
133 string."""
133 string."""
134
134
135 string_output = 0
135 string_output = 0
136 if out == 'str' or self.out == 'str':
136 if out == 'str' or self.out == 'str' or \
137 isinstance(self.out,cStringIO.OutputType):
138 # XXX - I don't really like this state handling logic, but at this
139 # point I don't want to make major changes, so adding the
140 # isinstance() check is the simplest I can do to ensure correct
141 # behavior.
137 out_old = self.out
142 out_old = self.out
138 self.out = cStringIO.StringIO()
143 self.out = cStringIO.StringIO()
139 string_output = 1
144 string_output = 1
@@ -1,3 +1,9 b''
1 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
2
3 * IPython/PyColorize.py (Parser.format2): fix state-handling
4 logic. I still don't like how that code handles state, but at
5 least now it should be correct, if inelegant. Closes #146.
6
1 2007-04-25 Ville Vainio <vivainio@gmail.com>
7 2007-04-25 Ville Vainio <vivainio@gmail.com>
2
8
3 * Extensions/ipy_which.py: added extension for %which magic, works
9 * Extensions/ipy_which.py: added extension for %which magic, works
General Comments 0
You need to be logged in to leave comments. Login now