dict.has_key(a) --> a in dict

has_key() is gone in python3, so use a more modern syntax here.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2012-02-05 13:40:06 +01:00
parent 8aba2800e6
commit 5c598d7e74
5 changed files with 8 additions and 8 deletions

View File

@ -209,7 +209,7 @@ def initInstanceLimit(instancename, instancemax):
"""Initialize the instance-limited thread implementation to permit
up to intancemax threads with the given instancename."""
instancelimitedlock.acquire()
if not instancelimitedsems.has_key(instancename):
if not instancename in instancelimitedsems:
instancelimitedsems[instancename] = BoundedSemaphore(instancemax)
instancelimitedlock.release()