On Sat, 26 Sep 2015 02:10:21 +0800
Yi Tseng <[email protected]> wrote:

> It seems that there is no "next" function in list_iterator in python3.4
> 
> https://github.com/osrg/ryu/commit/b7235b395a270e80bbf9ffadbff3098bd9a7d6de#diff-4150d480f095b6b0542de6c2e9a68431

How about the following?

diff --git a/ryu/topology/switches.py b/ryu/topology/switches.py
index f419838..5fe5d26 100644
--- a/ryu/topology/switches.py
+++ b/ryu/topology/switches.py
@@ -14,6 +14,7 @@
 # limitations under the License.
 
 import logging
+import six
 import struct
 import time
 import json
@@ -460,10 +461,10 @@ class LLDPPacket(object):
     def lldp_parse(data):
         pkt = packet.Packet(data)
         i = iter(pkt)
-        eth_pkt = i.next()
+        eth_pkt = six.next(i)
         assert type(eth_pkt) == ethernet.ethernet
 
-        lldp_pkt = i.next()
+        lldp_pkt = six.next(i)
         if type(lldp_pkt) != lldp.lldp:
             raise LLDPPacket.LLDPUnknownFormat()
 

------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to