#
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
# 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):
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(