a few more calls to list() for py3
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Sat, 31 Oct 2015 10:00:10 +0000 (11:00 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Sat, 31 Oct 2015 10:00:10 +0000 (11:00 +0100)
examples/ccn_emu_live/planetlab_4_nodes_linear.py
src/nepi/util/sfaapi.py
test/util/manifoldapi.py
test/util/sshfuncs.py

index bb3b449..e373619 100644 (file)
@@ -108,7 +108,7 @@ def post_process(ec, runs):
     low = numpy.array([float(m[1]) for m in metrics])
     high = numpy.array([float(m[2]) for m in metrics])
     error = [y - low, high - y]
-    x = list(range(1,runs + 1))
+    x = range(1,runs + 1)
 
     # plot average RTT and confidence interval for each iteration
     pyplot.errorbar(x, y, yerr = error, fmt='o')
index d3a56e7..f460b7e 100644 (file)
@@ -301,8 +301,7 @@ class SFAAPI(object):
         slice_res = self.get_slice_resources(slicename)['resource']
         if slice_res:
             if len(slice_res[0]['services']) != 0:
-                # 2to3 added list() and it is useful
-                slice_res_hrn = list(self.get_resources_hrn(slice_res).values())
+                slice_res_hrn = self.get_resources_hrn(slice_res).values()
                 if self._compare_lists(slice_res_hrn, resources_hrn):
                     return True
                 else: return len(slice_res_hrn)
index 05aae65..95053be 100755 (executable)
@@ -79,7 +79,7 @@ class MANIFOLDAPITestCase(unittest.TestCase):
 
         r_info = self.api.get_resource_info(fields=fields)
         value = r_info[10]
-        self.assertEqual(list(value.keys()), fields)
+        self.assertEqual(value.keys(), fields)
 
         # query with 2 filters and 2 fields
         r_info = self.api.get_resource_info(filters, fields)
index 68a0e94..ba738b1 100755 (executable)
@@ -100,7 +100,7 @@ def gen_sshd_config(filename, port, server_key, auth_keys):
 def gen_auth_keys(pubkey, output, environ):
     #opts = ['from="127.0.0.1/32"'] # fails in stupid yans setup
     opts = []
-    for k, v in list(environ.items()):
+    for k, v in environ.items():
         opts.append('environment="%s=%s"' % (k, v))
 
     with open(pubkey) as f: