the big merge
[nepi.git] / src / nepi / resources / netns / netnswrapper.py
index 9dff830..5a62194 100644 (file)
@@ -22,6 +22,8 @@ import os
 import sys
 import uuid
 
+from six import integer_types, string_types
+
 class NetNSWrapper(object):
     def __init__(self, loglevel = logging.INFO, enable_dump = False):
         super(NetNSWrapper, self).__init__()
@@ -111,10 +113,10 @@ class NetNSWrapper(object):
         result = method(*realargs, **realkwargs)
 
         # If the result is an object (not a base value),
-        # then keep track of the object a return the object
+        # then keep track of the object and 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