Reintroduce missing changes

This commit is contained in:
Hugo Posnic 2017-11-18 16:25:49 +01:00
parent 648f78c139
commit 461ae9fd57

View file

@ -8,7 +8,7 @@ ThreadPool Implementation
from __future__ import with_statement
from threading import Thread, RLock
from time import sleep
from Queue import Queue, Empty
from queue import Queue, Empty
import logging
import sys
@ -86,7 +86,7 @@ class ThreadPool:
'''
try:
return_value = self.callable(*self.arguments) #IGNORE:W0142
except Exception, excep: #IGNORE:W0703
except Exception as excep: #IGNORE:W0703
logger = logging.getLogger("threadpool.worker")
logger.warning("A job in the ThreadPool raised an exception: " + excep)
#else do nothing cause we don't know what to do...
@ -95,7 +95,7 @@ class ThreadPool:
try:
if (self.return_callback != None):
self.return_callback(return_value)
except Exception, _: #IGNORE:W0703 everything could go wrong...
except Exception as _: #IGNORE:W0703 everything could go wrong...
logger = logging.getLogger('threadpool')
logger.warning('Error while delivering return value to callback function')