diff options
author | Petr Viktorin <pviktori@redhat.com> | 2015-09-17 17:56:45 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2015-10-07 10:27:20 +0200 |
commit | e3c05fcb73c5a1081167d73278785bf18d652dab (patch) | |
tree | 2e812fea2e20b5808371975da090a829dd5c66f3 /ipalib/parameters.py | |
parent | 65e3b9edc66d7dfe885df143c16a59588af8192f (diff) | |
download | freeipa-e3c05fcb73c5a1081167d73278785bf18d652dab.tar.gz freeipa-e3c05fcb73c5a1081167d73278785bf18d652dab.tar.xz freeipa-e3c05fcb73c5a1081167d73278785bf18d652dab.zip |
Remove uses of the `types` module
In Python 3, the types module no longer provide alternate names for
built-in types, e.g. `types.StringType` can just be spelled `str`.
NoneType is also removed; it needs to be replaced with type(None)
Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipalib/parameters.py')
-rw-r--r-- | ipalib/parameters.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ipalib/parameters.py b/ipalib/parameters.py index 89c9b5067..34cd65d29 100644 --- a/ipalib/parameters.py +++ b/ipalib/parameters.py @@ -104,7 +104,6 @@ import decimal import base64 import datetime from six.moves.xmlrpc_client import MAXINT, MININT -from types import NoneType import encodings.idna import dns.name @@ -126,6 +125,7 @@ def _is_null(value): if six.PY3: unicode = str + class DefaultFrom(ReadOnly): """ Derive a default value from other supplied values. @@ -384,7 +384,7 @@ class Param(ReadOnly): # (direct) subclass must *always* override this class attribute. # If multiple types are permitted, set `type` to the canonical type and # `allowed_types` to a tuple of all allowed types. - type = NoneType # Ouch, this wont be very useful in the real world! + type = type(None) # Ouch, this wont be very useful in the real world! # Subclasses should override this with something more specific: type_error = _('incorrect type') |