From c916c961f34f47fdb25d5384370b0aed7e90ea49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Fri, 14 Aug 2009 16:23:31 +0200 Subject: EFAP --- portato/waiting_queue.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'portato/waiting_queue.py') 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) -- cgit v1.2.3