| Server IP : 85.214.239.14  /  Your IP : 216.73.216.212 Web Server : Apache/2.4.65 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 8.2.29 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /srv/modoboa/env/lib64/python3.5/site-packages/gevent/tests/  | 
Upload File :  | 
# If the logging module is imported *before* monkey patching,
# the existing handlers are correctly monkey patched to use gevent locks
import logging
logging.basicConfig()
import threading
import sys
PY2 = sys.version_info[0] == 2
def _inner_lock(lock):
    # The inner attribute changed between 2 and 3
    attr = getattr(lock, '_block' if not PY2 else '_RLock__block', None)
    return attr
def checkLocks(kind, ignore_none=True):
    handlers = logging._handlerList
    assert handlers
    for weakref in handlers:
        # In py26, these are actual handlers, not weakrefs
        handler = weakref() if callable(weakref) else weakref
        attr = _inner_lock(handler.lock)
        if attr is None and ignore_none:
            continue
        assert isinstance(attr, kind), (handler.lock, attr, kind)
    attr = _inner_lock(logging._lock)
    if attr is None and ignore_none:
        return
    assert isinstance(attr, kind)
checkLocks(type(threading._allocate_lock()))
import gevent.monkey
gevent.monkey.patch_all()
import gevent.lock
checkLocks(type(gevent.thread.allocate_lock()), ignore_none=False)