a
bê²^¿ ã @ s¼ d dl mZ d dlZd dlZd dlZd dlZd dlmZmZ ddl m
Z
dd„ Zdaed d
„ ƒZ
e
jZe ej¡eju r„eejƒZndZdd
„ Zedd„ ƒZdd„ Zg adaedd„ ƒZdS )é )Úprint_functionN)ÚclosingÚcontextmanageré )Ú_gic C sn t | dƒr| d¡ nTzddl}W n ty< tdƒ‚Y n.0 | ¡ }| ||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 ú5/usr/lib64/python3.9/site-packages/gi/_ossighelper.pyÚensure_socket_not_inheritable s
ÿ
r Fc # sÊ t rdV dS ddlm‰ t ¡ \‰} tˆƒ„ t| ƒX ˆ| fD ]}| d¡ t|ƒ qFzt |
¡ ¡}W n2 ty¢ dV Y W d ƒ W d ƒ dS 0 da ‡ ‡fdd„}z¦tj
dkrÔˆ j ˆ
¡ ¡}nˆ j ˆ
¡ ¡}ˆ |ˆ jˆ jjˆ jjB ˆ jjB ˆ jjB |¡}zdV W ˆ |¡ nˆ |¡ 0 W t |¡}||
¡ krXt |¡ da n(t |¡}||
¡ kr€t |¡ da 0 W d ƒ n1 sœ0 Y W d ƒ n1 s¼0 Y 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.
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 )ÚGLibFTc
sV |ˆ j @ rNztˆ d¡ƒW S tyH } zt|ƒ W Y d }~dS d }~0 0 dS dS d S )Nr FT)ZIO_INÚboolZrecvÚEnvironmentErrorÚprint)ÚsourceZ conditionÚe©r Zread_socketr r Ú
signal_notify\ s
z'wakeup_on_signal.