minor import fix

This commit is contained in:
Bernardo Damele 2012-07-10 13:13:21 +01:00
parent f219b39980
commit 115cd3479e

View File

@ -61,7 +61,6 @@ class ColorizingStreamHandler(logging.StreamHandler):
def output_colorized(self, message): def output_colorized(self, message):
self.stream.write(message) self.stream.write(message)
else: else:
import ctypes
import re import re
ansi_esc = re.compile(r'\x1b\[((?:\d+)(?:;(?:\d+))*)m') ansi_esc = re.compile(r'\x1b\[((?:\d+)(?:;(?:\d+))*)m')
@ -77,6 +76,8 @@ class ColorizingStreamHandler(logging.StreamHandler):
} }
def output_colorized(self, message): def output_colorized(self, message):
import ctypes
parts = self.ansi_esc.split(message) parts = self.ansi_esc.split(message)
write = self.stream.write write = self.stream.write
h = None h = None