Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraleherbau2011-06-03 07:46:54 -0400
committeraleherbau2011-06-03 07:46:54 -0400
commitfae8eeff08bde9128e4e3379db67a34e3c9dbfc8 (patch)
tree428084ecce1957f225d08513fde66762c35ee914 /python/src
parent8d4001044fedfebd3b27a84c2081a7979f7ba726 (diff)
downloadorg.eclipse.tcf-fae8eeff08bde9128e4e3379db67a34e3c9dbfc8.tar.gz
org.eclipse.tcf-fae8eeff08bde9128e4e3379db67a34e3c9dbfc8.tar.xz
org.eclipse.tcf-fae8eeff08bde9128e4e3379db67a34e3c9dbfc8.zip
TCF Python: Replace has_key with 3.x compatible 'in'
Diffstat (limited to 'python/src')
-rw-r--r--python/src/tcf/channel/AbstractChannel.py2
-rw-r--r--python/src/tcf/peer.py2
-rw-r--r--python/src/tcf/services/__init__.py4
-rw-r--r--python/src/tcf/util/sync.py4
4 files changed, 6 insertions, 6 deletions
diff --git a/python/src/tcf/channel/AbstractChannel.py b/python/src/tcf/channel/AbstractChannel.py
index 39ca084a8..e8b27922c 100644
--- a/python/src/tcf/channel/AbstractChannel.py
+++ b/python/src/tcf/channel/AbstractChannel.py
@@ -639,7 +639,7 @@ class AbstractChannel(object):
data = fromJSONSequence(msg.data)[0]
services.onChannelOpened(self, data, self.remote_service_by_name)
self.__makeServiceByClassMap(self.remote_service_by_name, self.remote_service_by_class)
- self.zero_copy = self.remote_service_by_name.has_key("ZeroCopy")
+ self.zero_copy = "ZeroCopy" in self.remote_service_by_name
if self.proxy and self.state == STATE_OPEN:
self.proxy.onEvent(msg.service, msg.name, msg.data)
elif hello:
diff --git a/python/src/tcf/peer.py b/python/src/tcf/peer.py
index 48269a385..f93092001 100644
--- a/python/src/tcf/peer.py
+++ b/python/src/tcf/peer.py
@@ -166,7 +166,7 @@ class AbstractPeer(TransientPeer):
peers = protocol.getLocator().getPeers()
if isinstance(peers.get(id), RemotePeer):
peers.get(id).dispose()
- assert not peers.has_key(id)
+ assert id not in peers
peers[id] = self
self.sendPeerAddedEvent()
diff --git a/python/src/tcf/services/__init__.py b/python/src/tcf/services/__init__.py
index dc7a1c050..9cad2fa40 100644
--- a/python/src/tcf/services/__init__.py
+++ b/python/src/tcf/services/__init__.py
@@ -43,7 +43,7 @@ def onChannelCreated(channel, services_by_name):
arr = provider.getLocalService(channel)
if not arr: continue
for service in arr:
- if services_by_name.has_key(service.getName()): continue
+ if service.getName() in services_by_name: continue
services_by_name[service.getName()] = service
except Exception as x:
protocol.log("Error calling TCF service provider", x);
@@ -59,7 +59,7 @@ def onChannelOpened(channel, service_names, services_by_name):
break
except Exception as x:
protocol.log("Error calling TCF service provider", x)
- if services_by_name.has_key(name): continue
+ if name in services_by_name: continue
services_by_name[name] = GenericProxy(channel, name)
def getServiceManagerID():
diff --git a/python/src/tcf/util/sync.py b/python/src/tcf/util/sync.py
index 2aad54532..d85434876 100644
--- a/python/src/tcf/util/sync.py
+++ b/python/src/tcf/util/sync.py
@@ -164,13 +164,13 @@ class CommandControl(object):
def _waitForCommand(self, token, timeout=None):
assert not protocol.isDispatchThread()
with self._lock:
- while self._pending.has_key(token.id):
+ while token.id in self._pending:
self._lock.wait(timeout)
if timeout: break
else:
if self._queue:
self._lock.wait(timeout)
- while self._pending.has_key(token.id):
+ while token.id in self._pending:
self._lock.wait(timeout)
if timeout: break
def cancel(self):

Back to the top