X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Futil%2Fmethod.py;h=7329036e400a55b03c3ff5f777eebc9124c19c80;hb=130e896408741add08ebc3a1b6c74aca11023c1e;hp=e99d55a8b020cc13eaa4658c5cfc5f5cb6c727a1;hpb=4a9e6751f9f396f463932133b9d62fc925a99ef6;p=sfa.git diff --git a/sfa/util/method.py b/sfa/util/method.py index e99d55a8..7329036e 100644 --- a/sfa/util/method.py +++ b/sfa/util/method.py @@ -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(