From 0a7492443c78d4791cfdf3d6384c02f1c7757c7b Mon Sep 17 00:00:00 2001 From: Dana Powers Date: Wed, 10 Jan 2018 15:56:47 -0800 Subject: Improve KafkaConsumer cleanup (#1339) --- kafka/util.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'kafka/util.py') diff --git a/kafka/util.py b/kafka/util.py index 181f67f..75538dd 100644 --- a/kafka/util.py +++ b/kafka/util.py @@ -167,6 +167,14 @@ class WeakMethod(object): return self._target_id == other._target_id and self._method_id == other._method_id +class Dict(dict): + """Utility class to support passing weakrefs to dicts + + See: https://docs.python.org/2/library/weakref.html + """ + pass + + def try_method_on_system_exit(obj, method, *args, **kwargs): def wrapper(_obj, _meth, *args, **kwargs): try: -- cgit v1.2.1