Updated stevedore to 2.0.1

This commit is contained in:
Labrys of Knossos 2022-11-29 01:47:46 -05:00
commit fb6011f88d
52 changed files with 581 additions and 1960 deletions

View file

@ -4,7 +4,7 @@ from ..util import compat
from ..util import langhelpers
def function_key_generator(namespace, fn, to_str=str):
def function_key_generator(namespace, fn, to_str=compat.string_type):
"""Return a function that generates a string
key, based on a given function as well as
arguments to the returned function itself.
@ -45,7 +45,7 @@ def function_key_generator(namespace, fn, to_str=str):
return generate_key
def function_multi_key_generator(namespace, fn, to_str=str):
def function_multi_key_generator(namespace, fn, to_str=compat.string_type):
if namespace is None:
namespace = "%s:%s" % (fn.__module__, fn.__name__)
@ -68,7 +68,7 @@ def function_multi_key_generator(namespace, fn, to_str=str):
return generate_keys
def kwarg_function_key_generator(namespace, fn, to_str=str):
def kwarg_function_key_generator(namespace, fn, to_str=compat.string_type):
"""Return a function that generates a string
key, based on a given function as well as
arguments to the returned function itself.
@ -131,7 +131,7 @@ def kwarg_function_key_generator(namespace, fn, to_str=str):
def sha1_mangle_key(key):
"""a SHA1 key mangler."""
if isinstance(key, str):
if isinstance(key, compat.text_type):
key = key.encode("utf-8")
return sha1(key).hexdigest()
@ -162,7 +162,7 @@ PluginLoader = langhelpers.PluginLoader
to_list = langhelpers.to_list
class repr_obj:
class repr_obj(object):
__slots__ = ("value", "max_chars")