diff options
| author | Eli Collins <elic@assurancetechnologies.com> | 2020-10-06 15:21:10 -0400 |
|---|---|---|
| committer | Eli Collins <elic@assurancetechnologies.com> | 2020-10-06 15:21:10 -0400 |
| commit | d212a5f864ac6bfae00f07ad0986fddacef78a98 (patch) | |
| tree | a5f5264c82f7ba583196b0c5a4b6e003e9905f0f /passlib/utils | |
| parent | b4bdc30c6309a107d0457d39c215f9000c03c052 (diff) | |
| download | passlib-d212a5f864ac6bfae00f07ad0986fddacef78a98.tar.gz | |
cleanup old python compat -- removed byte_elem_value() wrapper
Diffstat (limited to 'passlib/utils')
| -rw-r--r-- | passlib/utils/__init__.py | 4 | ||||
| -rw-r--r-- | passlib/utils/compat/__init__.py | 5 |
2 files changed, 2 insertions, 7 deletions
diff --git a/passlib/utils/__init__.py b/passlib/utils/__init__.py index e5ff515..aede331 100644 --- a/passlib/utils/__init__.py +++ b/passlib/utils/__init__.py @@ -63,7 +63,7 @@ from passlib.utils.decor import ( from passlib.exc import ExpectedStringError, ExpectedTypeError from passlib.utils.compat import (add_doc, join_bytes, join_byte_values, join_byte_elems, - join_unicode, byte_elem_value, + join_unicode, unicode_or_bytes, get_method_function, PYPY) # local @@ -629,7 +629,7 @@ def utf8_truncate(source, index): # loop until we find non-continuation byte while index < end: - if byte_elem_value(source[index]) & 0xC0 != 0x80: + if source[index] & 0xC0 != 0x80: # found single-char byte, or start-char byte. break # else: found continuation byte. diff --git a/passlib/utils/compat/__init__.py b/passlib/utils/compat/__init__.py index de69419..7852ea9 100644 --- a/passlib/utils/compat/__init__.py +++ b/passlib/utils/compat/__init__.py @@ -46,7 +46,6 @@ __all__ = [ 'str_to_bascii', 'join_unicode', 'join_bytes', 'join_byte_values', 'join_byte_elems', - 'byte_elem_value', 'iter_byte_values', # context helpers @@ -88,10 +87,6 @@ if True: # legacy PY3 indent join_byte_values = join_byte_elems = bytes - def byte_elem_value(elem): - assert isinstance(elem, int) - return elem - def iter_byte_values(s): assert isinstance(s, bytes) return s |
