Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/oslo_utils/__pycache__/eventletutils.cpython-39.pyc
Ðазад
a s�h� � @ s� d Z ddlZddlZddlmZ ddlmZ e�d�Ze�d�Ze eef�Z eg d��Zdd � Z ddd�Zd d� ZG dd� de�Zdd� ZdS )z6 Eventlet utils helper module. .. versionadded:: 1.3 � N)�importutils)� timeutilsZeventletzeventlet.patcher)�__builtin__ZMySQLdb�osZpsycopg�select�socket�thread�timec C s( t s tjS t�d�} | rtjS tjS dS )z�Get the current thread. If eventlet is used to monkey-patch the threading module, return the current eventlet greenthread. Otherwise, return the current Python thread. .. versionadded:: 1.5 r N)�EVENTLET_AVAILABLE� threading�current_thread�_patcher�is_monkey_patched� _eventletZ getcurrent)Zgreen_threaded� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/oslo_utils/eventletutils.py�fetch_current_thread_functor- s r �this libraryc C s� | st �� }nDt� }| D ]8}|dkr0|�t � q|t vrFtd| ��q|�|� qtr�zttj �}W n t yz d}Y n0 |r�g }t|�D ]}t�|�s�|� |� q�|r�tjd||f tdd� dS )a� Warns if eventlet is being used without patching provided modules. :param expected_patched_modules: list of modules to check to ensure that they are patched (and to warn if they are not); these names should correspond to the names passed into the eventlet monkey_patch() routine. If not provided then *all* the modules that could be patched are checked. The currently valid selection is one or multiple of ['MySQLdb', '__builtin__', 'all', 'os', 'psycopg', 'select', 'socket', 'thread', 'time'] (where 'all' has an inherent special meaning). :type expected_patched_modules: list/tuple/iterable :param what: string to merge into the warnings message to identify what is being checked (used in forming the emitted warnings message). :type what: string �allz1Unknown module '%s' requested to check if patchedTz�It is highly recommended that when eventlet is used that the %s modules are monkey patched when using %s (to avoid spurious or unexpected lock-ups and/or hangs)� )� stacklevelN)� _ALL_PATCH�copy�set�update� ValueError�addr �boolr Zalready_patched�AttributeError�sortedr �append�warnings�warn�RuntimeWarning)Zexpected_patched_modules�whatZexpanded_patched_modules�mZ maybe_patchedZnot_patchedr r r �warn_eventlet_not_patchedE s6 � ��r&