X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Fns3%2Fns3wrapper.py;h=7172ad1cc294c4330f4494883cbd4fc3d9511bbd;hb=3fe2e6f7812888dc1366915545dd2243ff6fb1bb;hp=a9a5e126f693096aa363ee134d239ea48c69c6c3;hpb=9199b66cf4e5c3bdf8926153a63084c352c40721;p=nepi.git diff --git a/src/nepi/resources/ns3/ns3wrapper.py b/src/nepi/resources/ns3/ns3wrapper.py index a9a5e126..7172ad1c 100644 --- a/src/nepi/resources/ns3/ns3wrapper.py +++ b/src/nepi/resources/ns3/ns3wrapper.py @@ -23,6 +23,8 @@ import threading import time import uuid +from six import integer_types, string_types + SINGLETON = "singleton::" SIMULATOR_UUID = "singleton::Simulator" CONFIG_UUID = "singleton::Config" @@ -326,8 +328,8 @@ class NS3Wrapper(object): # If the result is an object (not a base value), # then keep track of the object a return the object # reference (newuuid) - if not (result is None or type(result) in [ - bool, float, long, str, int]): + if result is not None \ + and not isinstance(result, (bool, float) + integer_types + string_types): self._objects[newuuid] = result result = newuuid @@ -482,7 +484,10 @@ class NS3Wrapper(object): condition.release() # contextId is defined as general context - contextId = long(0xffffffff) + # xxx possible distortion when upgrading to python3 + # really not sure what's the point in this long() business.. + #contextId = long(0xffffffff) + contextId = 0xffffffff # delay 0 means that the event is expected to execute inmediately delay = self.ns3.Seconds(0)