summaryrefslogtreecommitdiff
path: root/kazoo/python2atexit.py
diff options
context:
space:
mode:
Diffstat (limited to 'kazoo/python2atexit.py')
-rw-r--r--kazoo/python2atexit.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/kazoo/python2atexit.py b/kazoo/python2atexit.py
index a7f9e85..499dc34 100644
--- a/kazoo/python2atexit.py
+++ b/kazoo/python2atexit.py
@@ -27,6 +27,7 @@ def _run_exitfuncs():
exc_info = sys.exc_info()
except:
import traceback
+
sys.stderr.write("Error in atexit._run_exitfuncs:\n")
traceback.print_exc()
exc_info = sys.exc_info()
@@ -64,6 +65,7 @@ def unregister(func):
for e in handler_entries:
_exithandlers.remove(e)
+
if not hasattr(atexit, "unregister"):
# Only in python 2.x
atexit.register(_run_exitfuncs)