remove old/python2 references to types like IntType and the like
[sfa.git] / sfa / util / method.py
index e99d55a..7329036 100644 (file)
@@ -4,11 +4,9 @@
 #
 
 import time
-from types import IntType, LongType
 import textwrap
 
 from sfa.util.sfalogging import logger
-from sfa.util.py23 import StringType
 from sfa.util.faults import SfaFault, SfaInvalidAPIMethod, SfaInvalidArgumentCount, SfaInvalidArgument
 
 from sfa.storage.parameter import Parameter, Mixed, python_type, xmlrpc_type
@@ -239,12 +237,12 @@ class Method:
 
         # Strings are a special case. Accept either unicode or str
         # types if a string is expected.
-        if issubclass(expected_type, StringType) and isinstance(value, StringType):
+        if issubclass(expected_type, str) and isinstance(value, str):
             pass
 
         # Integers and long integers are also special types. Accept
         # either int or long types if an int or long is expected.
-        elif expected_type in (IntType, LongType) and isinstance(value, (IntType, LongType)):
+        elif expected_type is int and isinstance(value, int):
             pass
 
         elif not isinstance(value, expected_type):
@@ -254,7 +252,7 @@ class Method:
                                      name)
 
         # If a minimum or maximum (length, value) has been specified
-        if issubclass(expected_type, StringType):
+        if issubclass(expected_type, str):
             if min is not None and \
                len(value.encode(self.api.encoding)) < min:
                 raise SfaInvalidArgument(