X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=sfatables%2Fcommands%2Fmoo.py;fp=sfatables%2Fcommands%2Fmoo.py;h=65b7598e2458e9b1a71f40a4dc30cef0af5cdd97;hb=30d9951e075d93127c3909dcb41be09b420b3525;hp=a882854056e9edd54a86fc8f4710ab22c4d6dd60;hpb=faa98a764e6a311400ac54933fca910c8bdd1cf2;p=sfa.git diff --git a/sfatables/commands/moo.py b/sfatables/commands/moo.py index a8828540..65b7598e 100644 --- a/sfatables/commands/moo.py +++ b/sfatables/commands/moo.py @@ -1,5 +1,7 @@ import os, time +from sfa.util.py23 import StringType + class Command: commandline_options = [] help = "Add a new rule" @@ -152,7 +154,7 @@ class Command: # Strings are a special case. Accept either unicode or str # types if a string is expected. - if expected_type in StringTypes and isinstance(value, StringTypes): + if issubclass(expected_type, StringType) and isinstance(value, StringType): pass # Integers and long integers are also special types. Accept @@ -167,7 +169,7 @@ class Command: name) # If a minimum or maximum (length, value) has been specified - if expected_type in StringTypes: + if issubclass(expected_type, StringType): if min is not None and \ len(value.encode(self.api.encoding)) < min: raise SfaInvalidArgument("%s must be at least %d bytes long" % (name, min))