From 1a2925923f23aeee0c5eae72db57cc22350c7084 Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Thu, 12 Jul 2018 02:39:24 +0000 Subject: [PATCH] translate() -> replace() for Python 3 compatibility str.translate() works differently in Python 3 --- mininet/node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mininet/node.py b/mininet/node.py index 0a1907b..25accc5 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -893,7 +893,7 @@ class Switch( Node ): "Return correctly formatted dpid from dpid or switch name (s1 -> 1)" if dpid: # Remove any colons and make sure it's a good hex number - dpid = dpid.translate( None, ':' ) + dpid = dpid.replace( ':', '' ) assert len( dpid ) <= self.dpidLen and int( dpid, 16 ) >= 0 else: # Use hex of the first number in the switch name