minor speedup

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

View File

@ -836,10 +836,11 @@ 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:
logging._acquireLock()
if kb.get("multiThreadMode"):
logging._acquireLock()
# Reference: http://bugs.python.org/issue1602
if IS_WIN:
output = data.encode('ascii', "replace")
@ -861,7 +862,8 @@ def dataToStdout(data, forceOutput=False):
sys.stdout.write(data.encode(UNICODE_ENCODING))
finally:
sys.stdout.flush()
logging._releaseLock()
if kb.get("multiThreadMode"):
logging._releaseLock()
def dataToSessionFile(data):
if not conf.sessionFile or kb.suppressSession: