Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Leger2016-07-07 09:18:03 +0000
committerFrederic Leger2016-07-07 09:18:03 +0000
commit72c9f8995912207a44d31c82f74056248e882dba (patch)
tree58e4f7c74b1b3138b6abeffa80d505df8d56bab0 /python/src/tcf/peer.py
parent69846a1fda38662c05543d5b584086cf0fbc8406 (diff)
downloadorg.eclipse.tcf-72c9f8995912207a44d31c82f74056248e882dba.tar.gz
org.eclipse.tcf-72c9f8995912207a44d31c82f74056248e882dba.tar.xz
org.eclipse.tcf-72c9f8995912207a44d31c82f74056248e882dba.zip
TCF Python: Python 3 compliance.
The whole TCF python code should now be python 2 AND python 3 compatible. As there are few tests, I made sure this works by running the BasicTests.py and ProcessStart.py using both a python2 or python3 interpreter.
Diffstat (limited to 'python/src/tcf/peer.py')
-rw-r--r--python/src/tcf/peer.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/python/src/tcf/peer.py b/python/src/tcf/peer.py
index 665a25f34..89b79077b 100644
--- a/python/src/tcf/peer.py
+++ b/python/src/tcf/peer.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011, 2013-2014 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011, 2013-2014, 2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -326,11 +326,11 @@ class AbstractPeer(TransientPeer):
def updateAttributes(self, attrs):
equ = True
assert attrs.get(ATTR_ID) == self.rw_attrs.get(ATTR_ID)
- for key in self.rw_attrs.keys():
+ for key in list(self.rw_attrs.keys()):
if self.rw_attrs.get(key) != attrs.get(key):
equ = False
break
- for key in attrs.keys():
+ for key in list(attrs.keys()):
if attrs.get(key) != self.rw_attrs.get(key):
equ = False
break
@@ -350,8 +350,8 @@ class AbstractPeer(TransientPeer):
except IOError as x:
protocol.log("Locator: failed to send 'peerChanged' event", x)
self.last_heart_beat_time = timeVal
- elif self.last_heart_beat_time + locator.DATA_RETENTION_PERIOD / 4 \
- < timeVal:
+ elif self.last_heart_beat_time + \
+ int(locator.DATA_RETENTION_PERIOD / 4) < timeVal:
for l in protocol.getLocator().getListeners():
try:
l.peerHeartBeat(attrs.get(ATTR_ID))

Back to the top