HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/idlelib/__pycache__/run.cpython-310.opt-2.pyc
o

�iT�@sx	ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z
ddlZddlZddl
Z
ddl
mZddl
mZddl
mZddl
mZddl
mZddl
mZddl
mZddlZddlZeejd	d
�s�dD]
Zeee�ejde=qqd
ejd	_dZz
dZee_ee_Wn	e y�YnwdCdd�Z!	dDdd�Z"da#dd�Z$e$d�e�%�Z&e&fdd�Z'd
a(d
a)d
a*dEdd�Z+dd�Z,dd�Z-dd �Z.d!d"�Z/d#d$�Z0d%d&�Z1d'd(�Zd)d*�Z2d+d,�Z3d-Z4d.d/�Z5d0d1�Z6Gd2d3�d3ej7�Z8Gd4d5�d5ej9�Z:Gd6d7�d7e:�Z;Gd8d9�d9e:�Z<Gd:d;�d;ej=�Z>Gd<d=�d=�Z?e@d>k�r6dd?lAm+Z+e+d@dAdB�e$d
�dS)F�N)�autocomplete)�calltip)�
debugger_r)�
debugobj_r)�iomenu)�rpc)�stackviewerzidlelib.run�firstrun)ZsimpledialogZ
messagebox�fontZdialogZ
filedialogZcommondialog�ttkztkinter.Fz	127.0.0.1zCtrl-D (end-of-file)cCsX	d}|d||f7}|durt�||�}|��}|r!|d|7}|d|j|f7}|S)Nz!
Warning (from warnings module):
z  File "%s", line %s
z    %s
z%s: %s
)�	linecache�getline�strip�__name__)�message�category�filename�lineno�line�s�r�(/usr/local/lib/python3.10/idlelib/run.py�idle_formatwarning3srcCsB	|durtj}z|�t|||||��WdSty YdSw�N)�sys�stderr�writer�OSError)rrrr�filerrrr�idle_showwarning_subproc@s
��rcCs<	|rtdurtjatt_dSdStdurtt_dadSdSr)�_warnings_showwarning�warnings�showwarningr)�capturerrr�capture_warningsPs
��r$TcCs	|�d�dS)N�update)�eval)�tclrrr�handle_tk_events`sr(cCs�	|az	ttjd�}Wn
tdtjd�YdStd�dgtjdd�<tjt	dt
|ffd�}d|_|��	zGt
rLzt�Wn
tyKYWq8wz
tjjddd	�}Wntjybd}Ynw|r||\}\}}}||i|��}tj�||f�nt�WnDty�tr�da
Yq8ty�td
��t��\}	}
}z
t�tj�|df�Wntj|	|
|tjd�t�YnYq8Yq9)N���z/IDLE Subprocess: no IP port passed in sys.argv.�rT�Z
SockThread)�target�name�args皙�����?)�block�timeoutF)�no_exitfunc�intr�argv�print�
__stderr__r$�	threading�Thread�
manage_socket�	LOCALHOST�daemon�start�exit_now�exit�KeyboardInterruptrZ
request_queue�get�queue�EmptyZresponse_queue�putr(�quitting�
SystemExit�exc_info�print_exception�	traceback)Zdel_exitfunc�portZ
sockthread�request�seq�methodr.�kwargs�ret�type�value�tbrrr�mainnsl��
���
��rRcCs�td�D]1}t�|�zt|t�}Wn2ty5}ztd|jddtj	d�|}WYd}~qd}~wwtdtj	d�t
||�dadS|��dS)N�zIDLE Subprocess: OSError: �z, retrying....r*z8IDLE Subprocess: Connection to IDLE GUI failed, exiting.T)
�range�time�sleep�MyRPCServer�	MyHandlerrr5r.rr6�show_socket_errorr=Zhandle_request)�address�iZserver�errZsocket_errorrrrr9�s*

�����
r9cCsn	ddl}ddlm}|��}t|�|��|dd|d�d|d�d|j�d|j�d	�	|d
�|��dS)Nr)�	showerrorzSubprocess Connection Errorz#IDLE's subprocess can't connect to �:rTz.
Fatal OSError #z: zz.
See the 'Startup failure' section of the IDLE doc, online at
https://docs.python.org/3/library/idle.html#startup-failure)�parent)	�tkinterZtkinter.messageboxr^ZTk�fix_scalingZwithdraw�errno�strerrorZdestroy)r]r[rar^�rootrrrrZ�s ���rZcCsr	|ttfvr3t��}t�|��t�|||�Wd�n1s"wY|���	d�ddgSt
�||�S)N�
���)�AttributeError�	NameError�io�StringIO�
contextlib�redirect_stderrr�__excepthook__�getvalue�splitrH�format_exception_only)�typ�excrQr]rrr�get_message_lines�s�rtcsdddl}|��t�tj�t��\}}}}|\t_t_t_t	�����fdd���|||�dS)Nrc	s���t|��|j}|j}|dur't|��vr'�t|�||j�td�d�n|durC|jsCt|��vrC�t|�||j�td�d�|r^t�	|�}td�d�d}t
||�tj|�d�t|||�}|D]	}t|d�d�qfdS)NzF
The above exception was the direct cause of the following exception:
r*zE
During handling of the above exception, another exception occurred:
z"Traceback (most recent call last):)zrun.pyzrpc.pyzthreading.pyzqueue.pyz
debugger_r.pyzbdb.pyr+)�endr)
�add�id�__context__�	__cause__rO�
__traceback__r5�__suppress_context__rH�
extract_tb�cleanup_traceback�
print_listrt)	rrrsrQ�context�causeZtbe�exclude�linesr�Zefile�	print_exc�seenrrr��s4���

�z"print_exception.<locals>.print_exc)
r�
checkcache�flush_stdoutrrrF�	last_type�
last_value�last_traceback�set)rrr�valrQ�excinforr�rrG�srGc
Cs	|dd�}|r|D]
}|dd�|�rnqn|d=|s	|r7|D]
}|dd�|�r0nq#n|d=|s!t|�dkrN|dd�|dd�<tdtjd�tjdj}tt|��D])}||\}}}}	|dkrjd}|	s{|�	d�r{|�
d	d
||fi�}	||||	f||<qZdS)Nrr)z** IDLE Internal Exception: r*�exec�?z
-toplevel-z	<pyshell#rr
)�count�lenr5rrrZobjecttable�
rpchandlerrU�
startswithZ
remotecall)
rQr�Zorig_tbZrpcfiler�r\�fnZlnZnmrrrrr}s@������r}cCsdSrrrrrrr�.�r�cCs,	trddl}|��td�t�d�dS)NrF)r2�atexit�_clearr$rr>)r�rrrr>1sr>cCst	ddl}t|j�dd��}|dkr6|j�|�D]}|jj||dd�}t|d�}|dkr5td|�|d<qdSdS)	Nr�tk�scalinggffffff�?T)rer-�exists�sizeg�)	Ztkinter.font�floatr��callr
�namesZFontr3�round)rerar�r-r
r�rrrrb@s��rbcCs2|jdur
|jdnd}|t�t�|��|_dS)Nz

r+)�__doc__�textwrap�fill�dedent)Zfun�textZtemrrr�fixdocLsr��cs~	t�tj��fdd���t�dt�d��t�tj��fdd���t�dt�dt�d	��t�t��t��t_�t_dS)
NcsX|rtd��z|\}Wntytdt|��d���w|dks%td����|t�S)Nz.setrecursionlimit() takes no keyword argumentsz0setrecursionlimit() takes exactly one argument (z given)rz/recursion limit must be greater or equal than 1)�	TypeError�
ValueErrorr��__wrapped__�RECURSIONLIMIT_DELTA)r.rM�limit)�setrecursionlimitrrr�Vs �

���z:install_recursionlimit_wrappers.<locals>.setrecursionlimitz#            This IDLE wrapper adds z7 to prevent possible
            uninterruptible loops.cs���tSr)r�r�r)�getrecursionlimitrrr�ksz:install_recursionlimit_wrappers.<locals>.getrecursionlimitz(            This IDLE wrapper subtracts z# to compensate
            for the z" IDLE adds when setting the limit.)�	functools�wrapsrr�r�r�r�rr)r�r�r�install_recursionlimit_wrappersRs 

�
�
�
r�cCsP	ttjdd�r$ttjdd�r&tjjt_tjjt_t�t��t�dSdSdS)Nr�)�getattrrr�r�r�r�rrrr�!uninstall_recursionlimit_wrapperszs��

�r�c@seZdZdd�ZdS)rXcCs�	z�ty
�tydat��YdStj}tt�	dd�dt
��j�d|�d|�d�	�|d�t
jd|d	�tt�	d
d���|d�dat��YdS)NTz
            z(----------------------------------------zU
            Unhandled exception in user code execution server!'
            Thread: z"
            IDLE Client Address: z
            Request: r*i��)r�ra
            *** Unrecoverable, server exiting!

            Users should never see this message; it is likely transient.
            If this recurs, report this with a copy of the message
            and an explanation of how to make it repeat.
            )rE�EOFErrorr=�thread�interrupt_mainrr6r5r�r�r7�current_threadr-rHr�rD)�selfrJZclient_address�erfrrr�handle_error�s:�������zMyRPCServer.handle_errorN)r�
__module__�__qualname__r�rrrrrX�srXc@sBeZdZddd�Zedd��Zedd��Zed	d
��Zdd�Zd
S)�	StdioFile�utf-8�strictcCs||_||_||_||_dSr)�shell�tags�	_encoding�_errors)r�r�r��encoding�errorsrrr�__init__�s
zStdioFile.__init__cC�|jSr)r��r�rrrr���zStdioFile.encodingcCr�r)r�r�rrrr��r�zStdioFile.errorscCs
d|jS)Nz<%s>)r�r�rrrr-�s
zStdioFile.namecC�dS�NTrr�rrr�isatty�r�zStdioFile.isattyN)r�r�)	rr�r�r��propertyr�r�r-r�rrrrr��s



r�c@seZdZdd�Zdd�ZdS)�
StdOutputFilecCr�r�rr�rrr�writable�r�zStdOutputFile.writablecCs<|jrtd��t�||j|j��|j|j�}|j�||j	�S)Nzwrite to closed file)
�closedr��str�encoder�r��decoder�rr�)r�rrrrr�szStdOutputFile.writeN)rr�r�r�rrrrrr��sr�c@s4eZdZdZdd�Zddd�Zddd�Zd	d
�ZdS)
�StdInputFiler+cCr�r�rr�rrr�readable�r�zStdInputFile.readabler)cCs�|jrtd��|durd}nt|t�stdt|�j��|j}d|_|dkr:|j�	�}r8||7}|j�	�}s-|St
|�|krR|j�	�}|sHn
||7}t
|�|ks@||d�|_|d|�}|S)N�read from closed filer)�must be int, not r+r)r�r��
isinstancer3r�rOr�_line_bufferr��readliner�)r�r��resultrrrr�read�s*
�	�
�zStdInputFile.readcCs�|jrtd��|durd}nt|t�stdt|�j��|jp#|j�	�}|dkr,t
|�}|�dd|�}|dkr;|d}||d�|_|d|�S)Nr�r)r�rrfrT)r�r�r�r3r�rOrr�r�r�r��find)r�r�rZeolrrrr��s
zStdInputFile.readlinecCs|j��dSr)r��closer�rrrr��zStdInputFile.closeN)r))rr�r�r�r�r�r�r�rrrrr��s

r�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rYcCs�	t|�}|�d|�|�d�|_t|jdtjtj�t_	t
|jdtjtj�t_t
|jdtjd�t_t
jt_ddl}|j|_tj	|_t�|�d�|_t
jj|dd	d
�dS)Nr��console�stdin�stdoutr�backslashreplacer�interpr/)Zmyseq�wait)�	Executive�register�get_remote_proxyr�r�rr�r�rr�r�r�rr�displayhook�pydocZ
plainpagerZpagerZ_keep_stdinr�r��
RPCHandlerZgetresponse)r�Z	executiver�rrr�handles(���zMyHandler.handlecCs	t�d�dS)N�
)rVrWr�rrr�exithook szMyHandler.exithookcC�	dat��dSr��rDr�r�r�rrr�EOFhook$�zMyHandler.EOFhookcCr�r�r�r�rrr�decode_interrupthook*r�zMyHandler.decode_interrupthookN)rr�r�r�r�r�r�rrrrrYs
rYc@sNeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	ddd�Z
dS)r�cCs:||_tjdurtj|_t��|_t�	�|_dSi|_dS)NF)
r��idlelibZtesting�__main__�__dict__�localsrZCalltiprZAutoComplete)r�r�rrrr�3s


zExecutive.__init__c
Cs0zd|_daz
t||j�WdandawWn}tyR}z1|jr@|jd}t|td�tf�sGt	dt
|�tjd�WYd}~dSWYd}~dSWYd}~dSd}~wt�
�|_tr_t�tjtjurit�nztj|j�Wnt�
�|_t�Y|jj�d�}|r�|jj��YdSYdSt�dS)NTFrzSystemExit: r*z<<toggle-jit-stack-viewer>>)�
user_exc_info�
interruptabler�r�rEr.r�rOr3r5r�rrrFrDr>�
excepthookrnrGr�r�Zgetvarr�Zopen_remote_stack_viewerr�)r��code�e�obZjitrrr�runcode<s<
$��

�
zExecutive.runcodecCstrt��dSdSr)r�r�r�r�rrr�interrupt_the_server]s�zExecutive.interrupt_the_servercCst�|j|�Sr)rZstart_debuggerr�)r�Zgui_adap_oidrrr�start_the_debuggerar�zExecutive.start_the_debuggercCs	|j�|�dSr)r��
unregister)r�Zidb_adap_oidrrr�stop_the_debuggerdszExecutive.stop_the_debuggercCs|j�|�Sr)rZ	fetch_tip)r�r-rrr�get_the_calltiphszExecutive.get_the_calltipcCs|j�||�Sr)rZfetch_completions)r�Zwhat�moderrr�get_the_completion_listkr�z!Executive.get_the_completion_listNcCs�|jr
|j\}}}ndSd}|dur|j�|�}|r/|jjddvr/|j}|r/|jjddvs"|t_|t_t	�
||�}t�|�S)Nr)r�run)
r�r�r��tb_frame�	f_globals�tb_nextrr�r�rZ
StackTreeItemrZremote_object_tree_item)r�Z	flist_oidrrr�rQ�flist�itemrrrrns�
zExecutive.stackviewerr)rr�r�r�r�r�r�rrrrrrrrr�1s	!r�r�)rRzidlelib.idle_test.test_run�)�	verbosityr)NN)F)Brlr�rjrrArr�rVrH�_threadr�r7r!r�rrrrrrrr�ra�hasattr�modules�mod�delattrr	r:�eofr>�quitrirrr r$ZTclr'r(r=rDr�rRr9rZrtrGr}r�rbr�r�r�r�Z	RPCServerrX�
TextIOBaser�r�r�r�rYr�rZunittestrrrr�<module>s�

�

�


M$((/-
M