summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--portato/waiting_queue.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/portato/waiting_queue.py b/portato/waiting_queue.py
index d946abe..33791a3 100644
--- a/portato/waiting_queue.py
+++ b/portato/waiting_queue.py
@@ -36,10 +36,9 @@ class WaitingQueue (Queue):
def put (self, method, *args, **kwargs):
self.counter += 1;
- if "caller" in kwargs:
- name = "Waiting Thread #%d (called by:%s)" % (self.counter, kwargs["caller"])
- del kwargs["caller"]
- else:
+ try:
+ name = "Waiting Thread #%d (called by:%s)" % (self.counter, kwargs.pop("caller"))
+ except KeyError:
name = "Waiting Thread #%d" % self.counter
t = self.threadClass(name = name, target = method, args = args, kwargs = kwargs)