Bug fix for Python3 (drei lack of color output)

This commit is contained in:
Miroslav Stampar 2019-05-20 12:09:14 +02:00
parent ddf67bb876
commit 79d0c83f8f
2 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@ from lib.core.enums import OS
from thirdparty.six import unichr as _unichr
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.3.5.113"
VERSION = "1.3.5.114"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

View File

@ -94,7 +94,6 @@ class ColorizingStreamHandler(logging.StreamHandler):
def output_colorized(self, message):
parts = self.ansi_esc.split(message)
write = self.stream.write
h = None
fd = getattr(self.stream, 'fileno', None)
@ -108,7 +107,8 @@ class ColorizingStreamHandler(logging.StreamHandler):
text = parts.pop(0)
if text:
write(text)
self.stream.write(text)
self.stream.flush()
if parts:
params = parts.pop(0)