OwlCyberSecurity - MANAGER
Edit File: _ossighelper.cpython-36.pyc
3 ��<_�!������������������@���s����d�dl�mZ�d�dlZd�dlZd�dlZd�dlZd�dlZd�dlZd�dlm Z m Z �dd��Zdae dd���Z d d ��Ze��ZejZeje_ejge_ejej�ejkr�eej�ZndZdd ��Ze dd���Zdd��Zg�adae dd���ZdS�)�����)�print_functionN)�closing�contextmanagerc���������� ���C���sp���t�|�d�r|�jd��nVyddl}W�n�tk r>���td��Y�n.X�|�j��}|j||j�}|j||j||jB���dS�)z�Ensures that the socket is not inherited by child processes Raises: EnvironmentError NotImplementedError: With Python <3.4 on Windows �set_inheritableFr���Nz+Not implemented for older Python on Windows) �hasattrr����fcntl�ImportError�NotImplementedError�filenoZF_GETFDZF_SETFDZ FD_CLOEXEC)�sockr����fd�flags��r����$/usr/lib64/python3.6/_ossighelper.py�ensure_socket_not_inheritable���s���� r���Fc�������� ���'���#���s���t�rdV��dS�ddlm���tjdkp4tjdd��d k}�ttd�}|�sL|��rVdV��dS�tj ��\�}t ����"�t |����x"�|gD�]}|jd ��t|��q�W�yt j|j���}W�n�tk r����dV��dS�X�d a����fdd�}zxtjdk��r���jj�j���}n��jj�j���}��j|��j��jj��jjB���jjB���jjB�|�}z dV��W�d��j|��X�W�dt j|�}||j��k�rzt j|��d a�X�W�dQ�R�X�W�dQ�R�X�dS�)a���A decorator for functions which create a glib event loop to keep Python signal handlers working while the event loop is idling. In case an OS signal is received will wake the default event loop up shortly so that any registered Python signal handlers registered through signal.signal() can run. Works on Windows but needs Python 3.5+. In case the wrapped function is not called from the main thread it will be called as is and it will not wake up the default loop for signals. Nr���)�GLib�nt������������� socketpairFTc����������������sN���|��j�@�rFyt�jd��S��tk r@�}�zt|��dS�d�}~X�nX�dS�dS�d�S�)N����FT)ZIO_IN�boolZrecv�EnvironmentError�print)�sourceZ condition�e)r����read_socketr���r���� signal_notifyi���s���� z'wakeup_on_signal.<locals>.signal_notify)r���r���)�_wakeup_fd_is_activeZ gi.repositoryr����os�name�sys�version_infor����socketr���r���Zsetblockingr����signal� set_wakeup_fdr ���� ValueErrorZ IOChannelZwin32_new_socketZunix_newZio_add_watchZPRIORITY_DEFAULTZIOCondition�INZHUPZNVALZERRZ source_remove) Zset_wakeup_fd_supports_socketZhas_socketpairZwrite_socketr���Zorig_fdr���ZchannelZ source_idZwrite_fdr���)r���r���r����wakeup_on_signal8���sL���� r)���c���������������C���sJ���t�jdkrtjdd�tj�S�tjdkr<tjdtjd�d����S�tjd��S�d�S�)Nr���z python dll�cygwinzlibpython%d.%d.dllr���)r ���r!����ctypesZPyDLLr"���Z dllhandle�platformr#���r���r���r���r����create_pythonapi����s ���� r-���r���c���������������C���s ���t�jt�j�t�jkott�j�tkS�)z?Returns if on SIGINT the default Python handler would be called)r%���� getsignal�SIGINT�default_int_handler�PyOS_getsig�startup_sigint_ptrr���r���r���r����sigint_handler_is_default����s����r3���c�������������c���sb���t���s t�tjtj|���ttj�}z dV��W�dtjtj�|�kr\ttj�|kr\tjtjtj��X�dS�)z�Context manager for saving/restoring the SIGINT handler default state. Will only restore the default handler again if the handler is not changed while the context is active. N)r3����AssertionErrorr%���r/���r1���r.���r0���)ZhandlerZsig_ptrr���r���r����&sigint_handler_set_and_restore_default����s���� r5���c���������������C���s���t�j��jdkS�)z@Returns True in case the function is called from the main threadZ MainThread)� threadingZcurrent_threadr!���r���r���r���r����is_main_thread����s����r7���c�������������c���s����t���sdV��dS�t��sPtrFtj|���z dV��W�dtj��}trB|���X�ndV��dS�dadd��}tj|���zt|���dV��W�dQ�R�X�W�dtr�tjtj d��ntj���X�dS�)a���Installs a SIGINT signal handler in case the default Python one is active which calls 'callback' in case the signal occurs. Only does something if called from the main thread. In case of nested context managers the signal handler will be only installed once and the callbacks will be called in the reverse order of their registration. The old signal handler will be restored in case no signal handler is registered while the context is active. NFc�������������S���s���t�rd�S�da�tj�����d�S�)NT)�_sigint_called�_callback_stack�pop)Zsig_num�framer���r���r����sigint_handler����s����z0register_sigint_fallback.<locals>.sigint_handler) r7���r3���r9����appendr:���r8���r5���r%���r0���r/���)�callback�cbr<���r���r���r����register_sigint_fallback����s,���� r@������)Z __future__r���r ���r"���r$���r%���r+���r6���� contextlibr���r���r���r���r)���r-���Zpydllr1���Zc_void_pZrestypeZc_intZargtypesr.���r/���r0���r2���r3���r5���r7���r9���r8���r@���r���r���r���r����<module>���s0���V