[PATCH] color: reset win32 console color in a finally block

Adrian Buehlmann adrian at cadifra.com
Sat Apr 9 16:27:21 CDT 2011


On 2011-04-09 23:17, Idan K wrote:
> On Sun, Apr 10, 2011 at 12:10 AM, Adrian Buehlmann <adrian at cadifra.com>wrote:
> 
>> This seems to look good, but I'm just wondering: What exceptions did you
>> get that motivated this change?
>>
> 
> I guess the most probable one would be a very nicely timed
> KeyboardInterrupt.

Right. That's very well possible.

> I haven't actually checked if this makes a difference, maybe the console
> gets its old color by some miraculous way.
> It might be worth checking that first, although this can't hurt.

Ok. I think your change is fine. So you found that by reading the code,
right?

I was just a bit unsure if I might have incurred something strange in my
recent switch to using ctypes there.

Using this ctypes thingy is still relatively new, so I keep an eye on it
(crossing fingers, found nothing evil yet).



More information about the Mercurial-devel mailing list