diff options
author | 2015-05-12 14:03:56 +0200 | |
---|---|---|
committer | 2015-05-12 14:03:56 +0200 | |
commit | 304a42b914cde43a31a935181b0f952c726eee54 (patch) | |
tree | 104a496ed690c187a479cde5b829f4e76b21c1cd /pyload/manager/Scheduler.py | |
parent | Other import fixes (diff) | |
download | pyload-304a42b914cde43a31a935181b0f952c726eee54.tar.xz |
Other import fixes (2)
Diffstat (limited to 'pyload/manager/Scheduler.py')
-rw-r--r-- | pyload/manager/Scheduler.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pyload/manager/Scheduler.py b/pyload/manager/Scheduler.py index 630e43022..b82768aff 100644 --- a/pyload/manager/Scheduler.py +++ b/pyload/manager/Scheduler.py @@ -1,11 +1,10 @@ # -*- coding: utf-8 -*- # @author: mkaay +import heapq import threading import time -from heapq import heappop, heappush - class AlreadyCalled(Exception): pass @@ -125,7 +124,7 @@ class PriorityQueue(object): def put(self, element): self.lock.acquire() - heappush(self.queue, element) + heapq.heappush(self.queue, element) self.lock.release() @@ -133,7 +132,7 @@ class PriorityQueue(object): """ return element or None """ self.lock.acquire() try: - el = heappop(self.queue) + el = heapq.heappop(self.queue) return el except IndexError: return None, None |