Index: smart/fetcher.py =================================================================== --- smart/fetcher.py (revision 751) +++ smart/fetcher.py (working copy) @@ -644,6 +644,7 @@ class FetcherHandler(object): def __init__(self, fetcher): self._fetcher = fetcher + self._lock = thread.allocate_lock() self._queue = [] self._cancel = False @@ -890,7 +891,6 @@ FetcherHandler.__init__(self, *args) self._active = {} # ftp -> host self._inactive = {} # ftp -> (user, host, port) - self._lock = thread.allocate_lock() self._activelimit = {} # host -> num def tick(self): @@ -1091,8 +1091,7 @@ def __init__(self, *args): FetcherHandler.__init__(self, *args) self._active = 0 - self._lock = thread.allocate_lock() - + def tick(self): self._lock.acquire() if self._queue: @@ -1300,8 +1299,7 @@ opener = urllib2.build_opener(urllib2.CacheFTPHandler) urllib2.install_opener(opener) self._active = 0 - self._lock = thread.allocate_lock() - + def tick(self): self._lock.acquire() if self._queue: @@ -1459,8 +1457,7 @@ self._activelimit = {} # host -> num self._running = False self._multi = pycurl.CurlMulti() - self._lock = thread.allocate_lock() - + def tick(self): import pycurl @@ -1689,8 +1686,7 @@ def __init__(self, *args): FetcherHandler.__init__(self, *args) self._active = [] # item - self._lock = thread.allocate_lock() - + def tick(self): import ftplib self._lock.acquire()