o
    i
                     @   s@   d Z ddlZejeZejejejeZdd ZdS )z?Script injected into the debuggee process during attach-to-PID.    Nc                    s  d }zdd l  d jvrXz? fdd} fdd} fdd}tjtd	d
dd}tj|s1J  jd| dd l}|j	|||d  j
| W n   dd l}|    jdt z#dd l}dd l}ddlm}	m} dd l}
W  jd tks~J  jd= n jd tksJ  jd= w |
 }|d ur|jdd | d d ur|| d  |d|	|  | d dkr|| d  n| d dkr|j| d | d d ntt| W n   dd l}|  |d u r |  Y |d d S )Nr   	threadingc                       t |  jd d S N)fileprintstderrmsgsys ]/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/debugpy/server/attach_pid_injected.pyon_warn      zattach.<locals>.on_warnc                    r   r   r   r	   r   r   r   on_exception   r   zattach.<locals>.on_exceptionc                    r   r   r   r	   r   r   r   on_critical   r   zattach.<locals>.on_criticaldebugpy	_vendoredpydevdpydevd_attach_to_process)r   r   r   )jsonlogF)waitlog_toz!Configuring injected debugpy: {0}modelistenaddressconnectadapter_access_token)access_tokenzdebugpy injected successfully)r   modulesospathjoin_debugpy_direxistsinsertattach_scriptfix_main_thread_idremove	traceback	print_excr   debugpy.serverdebugpy.commonr   r   r   get_global_debugger#dispose_and_kill_all_pydevd_threadsr   inforeprr   r   AssertionErrorreraise_exception)setupr   r   r   r   pydevd_attach_to_process_pathr(   r+   r   r   r   py_dbr   r   r   attach   sr   




r8   )__doc__r"   r#   abspath__file__dirnamer%   r8   r   r   r   r   <module>   s
   