File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""A eventlet based handler."""
22from __future__ import absolute_import
33
4+ import atexit
45import contextlib
56import logging
67
1213from eventlet import queue as green_queue
1314
1415from kazoo .handlers import utils
15- import kazoo .python2atexit as python2atexit
1616from kazoo .handlers .utils import selector_select
1717
1818LOG = logging .getLogger (__name__ )
@@ -140,15 +140,15 @@ def start(self):
140140 w = eventlet .spawn (self ._process_callback_queue )
141141 self ._workers .append ((w , self .callback_queue ))
142142 self ._started = True
143- python2atexit .register (self .stop )
143+ atexit .register (self .stop )
144144
145145 def stop (self ):
146146 while self ._workers :
147147 w , q = self ._workers .pop ()
148148 q .put (_STOP )
149149 w .wait ()
150150 self ._started = False
151- python2atexit .unregister (self .stop )
151+ atexit .unregister (self .stop )
152152
153153 def socket (self , * args , ** kwargs ):
154154 return utils .create_tcp_socket (green_socket )
Original file line number Diff line number Diff line change 11"""A gevent based handler."""
22from __future__ import absolute_import
33
4+ import atexit
45import logging
56
67import gevent
1920 from gevent .coros import Semaphore , RLock
2021
2122from kazoo .handlers import utils
22- from kazoo import python2atexit
2323
2424_using_libevent = gevent .__version__ .startswith ("0." )
2525
@@ -104,7 +104,7 @@ def start(self):
104104 for queue in (self .callback_queue ,):
105105 w = self ._create_greenlet_worker (queue )
106106 self ._workers .append (w )
107- python2atexit .register (self .stop )
107+ atexit .register (self .stop )
108108
109109 def stop (self ):
110110 """Stop the greenlet workers and empty all queues."""
@@ -124,7 +124,7 @@ def stop(self):
124124 # Clear the queues
125125 self .callback_queue = self .queue_impl () # pragma: nocover
126126
127- python2atexit .unregister (self .stop )
127+ atexit .unregister (self .stop )
128128
129129 def select (self , * args , ** kwargs ):
130130 return selector_select (
Original file line number Diff line number Diff line change 1212"""
1313from __future__ import absolute_import
1414
15+ import atexit
1516import logging
1617import queue
1718import socket
1819import threading
1920import time
2021
21- import kazoo .python2atexit as python2atexit
2222from kazoo .handlers import utils
2323from kazoo .handlers .utils import selector_select
2424
@@ -141,7 +141,7 @@ def start(self):
141141 w = self ._create_thread_worker (work_queue )
142142 self ._workers .append (w )
143143 self ._running = True
144- python2atexit .register (self .stop )
144+ atexit .register (self .stop )
145145
146146 def stop (self ):
147147 """Stop the worker threads and empty all queues."""
@@ -162,7 +162,7 @@ def stop(self):
162162 # Clear the queues
163163 self .callback_queue = self .queue_impl ()
164164 self .completion_queue = self .queue_impl ()
165- python2atexit .unregister (self .stop )
165+ atexit .unregister (self .stop )
166166
167167 def select (self , * args , ** kwargs ):
168168 return selector_select (* args , ** kwargs )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11"""Kazoo testing harnesses"""
2+ import atexit
23import logging
34import os
45import uuid
56import unittest
67
7- from kazoo import python2atexit as atexit
88from kazoo .client import KazooClient
99from kazoo .exceptions import KazooException
1010from kazoo .protocol .connection import _CONNECTION_DROP , _SESSION_EXPIRED
You can’t perform that action at this time.
0 commit comments