minor speedup

This commit is contained in:
Miroslav Stampar 2011-12-27 11:41:57 +00:00
parent b02363b1aa
commit 0a6334db22

View File

@ -836,9 +836,10 @@ def singleTimeLogMessage(message, level=logging.INFO, flag=None):
logger.log(level, message)
def dataToStdout(data, forceOutput=False):
if not ('threadException' in kb and kb.threadException):
if not kb.get("threadException"):
if forceOutput or not getCurrentThreadData().disableStdOut:
try:
if kb.get("multiThreadMode"):
logging._acquireLock()
# Reference: http://bugs.python.org/issue1602
if IS_WIN:
@ -861,6 +862,7 @@ def dataToStdout(data, forceOutput=False):
sys.stdout.write(data.encode(UNICODE_ENCODING))
finally:
sys.stdout.flush()
if kb.get("multiThreadMode"):
logging._releaseLock()
def dataToSessionFile(data):