diff options
| author | Eli Collins <elic@assurancetechnologies.com> | 2020-10-06 15:26:59 -0400 |
|---|---|---|
| committer | Eli Collins <elic@assurancetechnologies.com> | 2020-10-06 15:26:59 -0400 |
| commit | 034adeef2a3e8582135002ee61b38fe7063b4f6e (patch) | |
| tree | 7cce4f03d736427a52eb814edc3737e80a32b08a /passlib/utils | |
| parent | 240ffe471e48f9d36de936389f88b69f10166032 (diff) | |
| download | passlib-034adeef2a3e8582135002ee61b38fe7063b4f6e.tar.gz | |
cleanup old python compat -- removed int_types alias
Diffstat (limited to 'passlib/utils')
| -rw-r--r-- | passlib/utils/compat/__init__.py | 2 | ||||
| -rw-r--r-- | passlib/utils/handlers.py | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/passlib/utils/compat/__init__.py b/passlib/utils/compat/__init__.py index f90d914..06bd266 100644 --- a/passlib/utils/compat/__init__.py +++ b/passlib/utils/compat/__init__.py @@ -37,7 +37,6 @@ def add_doc(obj, doc): __all__ = [ # type detection ## 'is_mapping', - 'int_types', 'num_types', 'unicode_or_bytes', @@ -100,7 +99,6 @@ add_doc(iter_byte_chars, "iterate over byte string as sequence of 1-byte strings # numeric #============================================================================= -int_types = (int,) num_types = (int, float) #============================================================================= diff --git a/passlib/utils/handlers.py b/passlib/utils/handlers.py index 8c02e69..97ac757 100644 --- a/passlib/utils/handlers.py +++ b/passlib/utils/handlers.py @@ -26,7 +26,7 @@ from passlib.utils.binary import ( HEX_CHARS, UPPER_HEX_CHARS, LOWER_HEX_CHARS, ALL_BYTE_VALUES, ) -from passlib.utils.compat import join_unicode, unicode_or_bytes, int_types +from passlib.utils.compat import join_unicode, unicode_or_bytes from passlib.utils.decor import classproperty, deprecated_method # local __all__ = [ @@ -369,7 +369,7 @@ def norm_integer(handler, value, min=1, max=None, # * :returns: validated value """ # check type - if not isinstance(value, int_types): + if not isinstance(value, int): raise exc.ExpectedTypeError(value, "integer", param) # check minimum @@ -1739,7 +1739,7 @@ class HasRounds(GenericHandler): vary_rounds = int(default_rounds * vary_rounds) # calculate bounds based on default_rounds +/- vary_rounds - assert vary_rounds >= 0 and isinstance(vary_rounds, int_types) + assert vary_rounds >= 0 and isinstance(vary_rounds, int) lower = linear_to_native(default_rounds - vary_rounds, False) upper = linear_to_native(default_rounds + vary_rounds, True) return cls._clip_to_desired_rounds(lower), cls._clip_to_desired_rounds(upper) |
