+
    hvh!  c                   sb   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIHtHt ^RIH	t	 R t
Rs ]R 4       t]	P                  t]	P                  t]P"                  ! ]P$                  4      ]P&                  J d   ]! ]P$                  4      tMRtR t]R 4       tR	 t. sRs]R
 4       t ! R R4      tR tR# )i    N)closingcontextmanager)_gic                s<   \        V R4      '       d   V P                  R4       R#  ^ RIpV P                  4       pVP                  W!P                  4      pVP                  W!P
                  W1P                  ,          4       R#   \         d    \        R4      hi ; i)zEnsures that the socket is not inherited by child processes.

Raises:
    EnvironmentError
    NotImplementedError: With Python <3.4 on Windows

set_inheritableFNz+Not implemented for older Python on Windows)	Zhasattrr   fcntlfilenoZF_GETFDZF_SETFDZ
FD_CLOEXECZImportErrorZNotImplementedError)sockr   ZfdZflags   &   6/usr/lib64/python3.14/site-packages/gi/_ossighelper.pyensure_socket_not_inheritabler	      s     t&''U#	E BKKMM2EKKMM53C3C+CD  	U%&STT	Us   B BFc            
   #  sl  aa"   \         '       d   Rx  R# ^ RIHo \        P                  ! 4       w  op \        S4      ;_uu_ 4        \        V 4      ;_uu_ 4        SV 3 F  pVP                  R4       \        V4       K!  	   \        P                  ! V P                  4       4      pRs TT3R lp \        P                  R8X  d+   SP                  P                  SP                  4       4      pM)SP                  P!                  SP                  4       4      pSP#                  TSP$                  SP&                  P(                  SP&                  P*                  ,          SP&                  P,                  ,          SP&                  P.                  ,          T4      p Rx  SP1                  T4        \        P                  ! T4      pY`P                  4       8w  d   \        P                  ! T4       Rs  RRR4       RRR4       R#   \         d    Rx   RRR4       RRR4       R# i ; i  SP1                  T4       i ; i  \        P                  ! T4      pY`P                  4       8w  d   \        P                  ! T4       Rs i ; i  + '       g   i     L; i  + '       g   i     R# ; i5i)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.
N)GLibFTc                 s   < VSP                   ,          '       d    \        SP                  ^4      4      # R#   \         d     R# i ; i)i   F)ZIO_INZboolZrecvZOSError)ZsourceZ	conditionr
   read_sockets   &&r   signal_notifyZ'wakeup_on_signal.<locals>.signal_notifyY   sF    4::%%! 0 0 344   ! !s   8 AAZnt)_wakeup_fd_is_activeZgi.repositoryr
   socketZ
socketpairr    Zsetblockingr	   signalZset_wakeup_fdr   Z
ValueErrorosnameZ	IOChannelZwin32_new_socketZunix_newZio_add_watchZPRIORITY_DEFAULTZIOConditionZINZHUPZNVALZERRZsource_remove)	Zwrite_socketr   Zorig_fdr   ZchannelZ	source_idZwrite_fdr
   r   s	          @@r   wakeup_on_signalr   6   s     " & 1 1 3K			w|44 ,/DU#)$/ 0	(**<+>+>+@AG $( 		)ww$..99+:L:L:NO..11+2D2D2FG))%%$$''&&**+&&++, &&**+
 
I.""9-++G4H..00 $$X.#( e  5		  	  5			H ""9-++G4H..00 $$X.#( e  54			s   AJ4J (J	$H
)	J	3C+IH0#I5AJ	8J  
J4
H-J	J "
J4,H--J	0IIAJ

J	JJ  J1	+	J4c                 s    \         P                  ! \         P                  4      \         P                  J ;'       d!    \	        \         P                  4      \
        8H  # )z@Returns if on SIGINT the default Python handler would be called.)r   	getsignalSIGINTdefault_int_handlerPyOS_getsigstartup_sigint_ptr     r   sigint_handler_is_defaultr      sB     	'6+E+EE 	= 	=&*<<r   c              #  s  "   \         P                   ! \         P                  V 4       \        \         P                  4      p Rx  \         P                  ! \         P                  4      V J dV   \        \         P                  4      V8X  d6   \         P                   ! \         P                  \         P                  4       R# R# R#   \         P                  ! \         P                  4      T J dT   \        \         P                  4      T8X  d5   \         P                   ! \         P                  \         P                  4       i i i ; i5i)zContext 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)r   r   r   r   r   )ZhandlerZsig_ptrs   & r   &sigint_handler_set_and_restore_defaultr      s      MM&--)&--(GE V]]+w6FMM*g5MM&--)C)CD 6 7FV]]+w6FMM*g5MM&--)C)CD 6 7s   ?EC A?EA=EEc                 sF    \         P                  ! 4       P                  R8H  # )zAReturns True in case the function is called from the main thread.Z
MainThread)	threadingZcurrent_threadr   r   r   r   is_main_threadr      s    ##%**l::r   c              #  s  "   \        4       '       g   Rx  R# \        4       '       gV   \        '       dD   \        P                  V 4        Rx  \        P	                  4       p\
        '       d   V! 4        R# Rx  R# RsR p\        P                  V 4        \        V4      ;_uu_ 4        Rx  RRR4       \
        '       d(   \        P                  ! \        P                  R4       R# \        P	                  4        R#   \        P	                  4       p\
        '       d	   T! 4        i i ; i  + '       g   i     L; i  \
        '       d'   \        P                  ! \        P                  R4       i \        P	                  4        i ; i5i)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                 sX    \         '       d   R # Rs \        P                  4       ! 4        R # )NT)_sigint_called_callback_stackpop)Zsig_numZframe   &&r   sigint_handlerZ0register_sigint_fallback.<locals>.sigint_handler   s      >r   )
r   r   r   Zappendr    r   r   r   r   r   )ZcallbackZcbr"   s   &  r   register_sigint_fallbackr#      s    , $&&? ""8,$((*!>D 	 N  8$"3NCC D >&&v}}d;!5 %((*!>D "& DC >&&v}}d;!sU   2FFD A	FE ,D/1E 9A	F*D,,F/D?	:E AF

Fc                   sT   a  ] tR t^t o ]]R 4       4       t]]R 4       4       tRtV t	R# )DummyEventLoopc              #  s   "   R x  R # 5iNr   )clss   &r   pausedZDummyEventLoop.paused   s
      	s   	c              #  st   "   \        4       ;_uu_ 4        R x  R R R 4       R #   + '       g   i     R # ; i5ir%   )r   )r&   Z	quit_funcr!   r   runningZDummyEventLoop.running   s!        s   8$
85		8r   N)
Z__name__Z
__module__Z__qualname__Z__firstlineno__Zclassmethodr   r'   r(   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r$   r$      s;          r   r$   c                sV   ^RI Hp \        P                  ! 4       pVfB   \        P                  ! 4       p\        W1P                  4      '       d   VP                  V 4      p\        W!P                  4      '       d*   V e&   \        VP                  4      \        V 4      8X  d   V# \        # )z]Return the correct GLibEventLoop or a dummy that just registers the
signal wakeup mechanism.
)events) r)   asyncioZ_get_running_loopZget_event_loop_policyZ
isinstanceZGLibEventLoopPolicyZget_event_loop_for_contextZGLibEventLoopZhashZ_contextr$   )Zctxr)   ZloopZpolicyr   r   get_event_loopr,      s     
 $$&D|..0f889944S9D 	4--..O49,r   i)r   r   r   r+   r   Z
contextlibr    r   r*   r   r	   r   r   Zpyos_getsigr   Zpyos_setsigZPyOS_setsigr   r   r   r   r   r   r   r   r   r#   r$   r,   r   r   r   <module>r-      s   " 
     . E*  
 F) F)R oooo 
FMM"f&@&@@$V]]3  E E(;
  ;" ;"|
 
r   