python (3.11.7)

(root)/
lib/
python3.11/
idlelib/
__pycache__/
run.cpython-311.opt-1.pyc

eS^dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
ZddlZddl
Z
ddlZddlmZddlmZddlmZddlmZddlmZddlmZdd	lmZddlZddlZeejd
ds.dD]Zeeeejd
ez=dejd
_dZ	dZee_ee _n#e!$rYnwxYwd4dZ"	d5dZ#da$dZ%e%dej&Z'e'fdZ(da)da*da+d6dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZdZ3dZ4d Z5d!Z6d"Z7Gd#d$ej8Z9Gd%d&ej:Z;Gd'd(e;Z<Gd)d*e;Z=Gd+d,ej>Z?Gd-d.Z@eAd/krdd0lBm,Z,e,d1d23e%ddS)7z idlelib.run

Simplified, pyshell.ModifiedInterpreter spawns a subprocess with
f'''{sys.executable} -c "__import__('idlelib.run').run.main()"'''
'.run' is needed because __import__ returns idlelib, not idlelib.run.
N)autocomplete)calltip)
debugger_r)
debugobj_r)iomenu)rpc)stackviewerzidlelib.runfirstrun)simpledialog
messageboxfontdialog
filedialogcommondialogttkztkinter.Fz	127.0.0.1zCtrl-D (end-of-file)cd}|d|d|dz
}|tj||}|}|r|d|zz
}||jd|dz
}|S)zFormat warnings the IDLE way.z!
Warning (from warnings module):
z  File "z", line 
Nz    %s
: )	linecachegetlinestrip__name__)messagecategoryfilenamelinenoliness      ?/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/idlelib/run.pyidle_formatwarningr 3s	.A	2X	2	2	2	2	22A| 622::<<D	Z$
H	,	,	,	,	,,AHc	|tj}	|t|||||dS#t$rYdSwxYw)zuShow Idle-format warning after replacing warnings.showwarning.

    The only difference is the formatter called.
    N)sysstderrwriter OSError)rrrrfilers      ridle_showwarning_subprocr(@so|z


%8VT;;	<	<	<	<	<



s&8
AAc|r(ttjatt_dSdSttt_dadSdS)zFReplace warning.showwarning with idle_showwarning_subproc, or reverse.N)_warnings_showwarningwarningsshowwarningr()captures rcapture_warningsr.PsU) ($,$8!#;H   )(!,#8H $(!!!-,r!Tc0|ddS)zProcess any tk events that are ready to be dispatched if tkinter
    has been imported, a tcl interpreter has been created and tk has been
    loaded.updateN)eval)tcls rhandle_tk_eventsr3`sHHXr!c|a	ttjd}n##t	dtjYdSxYwt
ddgtjdd<tjtdt|ffd		tr 	tn#t$rY%wxYw	tjdd	
}n#t$j$rd}YnwxYw|r3|\}\}}}||i|}tj||fnt-n#t$rt.rdaYt0$rt
dtj\}}	}
	t5tj|dfY #t7j||	|
tjtYnxYwYnxYw])afStart the Python execution server in a subprocess

    In the Python subprocess, RPCServer is instantiated with handlerclass
    MyHandler, which inherits register/unregister methods from RPCHandler via
    the mix-in class SocketIO.

    When the RPCServer 'server' is instantiated, the TCPServer initialization
    creates an instance of run.MyHandler and calls its handle() method.
    handle() instantiates a run.Executive object, passing it a reference to the
    MyHandler object.  That reference is saved as attribute rpchandler of the
    Executive instance.  The Executive methods have access to the reference and
    can pass it on to entities that they command
    (e.g. debugger_r.Debugger.start_debugger()).  The latter, in turn, can
    call MyHandler(SocketIO) register/unregister methods via the reference to
    register and unregister themselves.

    z/IDLE Subprocess: no IP port passed in sys.argv.r'NT
SockThread)targetnameargsdaemon皙?)blocktimeoutF)no_exitfuncintr#argvprint
__stderr__r.	threadingThread
manage_socket	LOCALHOSTstartexit_nowexitKeyboardInterruptr
request_queuegetqueueEmptyresponse_queueputr3quitting
SystemExitexc_infoprint_exception	traceback)del_exitfuncportrequestseqmethodr;kwargsrettypevaluetbs           rmainrbnsZ*K38B<  
?>	#	#	#	#T$CHQQQK
M&%t,. eggg%$	
FFFF(H
+//dD/II;




#.5++fdFfd-f--"&&Sz2222 """ 			
 H			U###
	!lnnOD%
!!!"&&T{333
)$rOOOOG%sv$A!E)B87E8
CECE	!C+*E+C?<E>C??AEG81G8
/F??2G31G8ctdD]r}tj|	t|t}nt#t
$r8}t
d|jdzdztj	|}Yd}~kd}~wwxYwt
dtj	t||dadS|dS)NzIDLE Subprocess: OSError: z, retrying....r6z8IDLE Subprocess: Connection to IDLE GUI failed, exiting.T)
rangetimesleepMyRPCServer	MyHandlerr&rCr;r#rDshow_socket_errorrJhandle_request)addressiservererrsocket_errors     rrGrGs
1XX
1


	 )44FE			.!<"#),
9
9
9
9LLLLLL	
	*03	@	@	@	@,000
s>
B.A;;Bcddl}ddlm}|j}t	|||dd|dd|dd|jd	|jd
	||dS)z(Display socket error from manage_socket.rN)	showerrorzSubprocess Connection Errorz#IDLE's subprocess can't connect to :rez.
Fatal OSError #rzz.
See the 'Startup failure' section of the IDLE doc, online at
https://docs.python.org/3/library/idle.html#startup-failure)parent)	tkintertkinter.messageboxrsTkfix_scalingwithdrawerrnostrerrordestroy)rprmrvrsroots     rrkrksNNN,,,,,,7:<<DMMOOO
I)
J'!*
J
Jwqz
J
J!i
J
J+.<
J
J
J
	LLNNNNNr!cX|ttfvrtj}t	j|5t
j|||dddn#1swxYwY|	dddzgStj||S)z,Return line composing the exception message.Nr)AttributeError	NameErrorioStringIO
contextlibredirect_stderrr#__excepthook__getvaluesplitrWformat_exception_only)typexcrarps    rget_message_linesrs
~y)))kmm

'
,
,	-	-sC,,,	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-$$T**2.566.sC888sAA"Ac$ddl}|jttjtjx\}}}}|\t_t_t_tfd|||dS)Nrcrt||j}|j}|Bt|vr1
t	|||jt
d	nJ|H|jsAt|vr0
t	|||jt
d	|rMtj	|}t
d	d}t||tj|	t|||}|D]}t
|d	dS)NzF
The above exception was the direct cause of the following exception:
r6zE
During handling of the above exception, another exception occurred:
z"Traceback (most recent call last):)zrun.pyzrpc.pyzthreading.pyzqueue.pyz
debugger_r.pyzbdb.pyr7)endr')
addid__context__	__cause__r_
__traceback__rC__suppress_context__rW
extract_tbcleanup_traceback
print_listr)rrracontextcausetbeexcludelinesrefile	print_excseens         rrz"print_exception.<locals>.print_excsyC/
E$!6!6Id5kk5%*=>>>28=
?
?
?
?
?!*"kk%%Id7mmWg.CDDD28=
?
?
?
?
	2&r**C6UCCCC2Gc7+++ 51111!#sB//	,	,D$BU+++++	,	,r!)
r
checkcacheflush_stdoutr#r$rU	last_type
last_valuelast_tracebackset)rrvalraexcinforrrs     @@@rrVrVsINNNJE \^^+LCb78?5CM3>3#555D,,,,,,,2Ic3r!c^|dd}|r.|D]%}|dd|rn&n|d=|.|r.|D]%}|dd|rn&n|d=|.t|dkr*|dd|dd<tdtjt
jdj}tt|D]Q}||\}}}}	|dkrd}|	s/|	d	r|
d
d||fi}	||||	f||<RdS)zARemove excluded traces from beginning/end of tb; get cached linesNrr5z** IDLE Internal Exception: r6exec?z
-toplevel-z	<pyshell#rr)countlenrCr#r$robjecttable
rpchandlerrf
startswith
remotecall)
rarorig_tbrpcfilerrnfnlnnmrs
          rrrseG
		G!uQx~~g&&


qE


		G"vayw''


rF

2ww!||
111
,3:>>>>(3J
3r77^^!!a5BD
99B	<

k22	<((i/12h<<DBD 1!!r!cdS)zXXX How to do this now?Nrr!rrr/sr!ctrddl}|tdt	jddS)zExit subprocess, possibly after first clearing exit functions.

    If config-main.cfg/.def 'General' 'delete-exitfunc' is True, then any
    functions registered with atexit will be removed before exiting.
    (VPython support)

    rNF)r@atexit_clearr.r#rK)rs rrKrK2sA




UHQKKKKKr!cBddl}t|jdd}|dkrj|j|D]Q}|j||d}t|d}|dkrtd	|z|d<PdSdS)
zScale fonts on HiDPI displays.rNtkscalinggffffff?T)r~r:existssizeg)	tkinter.fontfloatrcallr
namesFontrAround)r~rvrr:r
rs      rryryAsDGLLy1122G}}L&&t,,	1	1D<$$$T$$GGDtF|$$Daxx$U4Z00V}	1	1r!c|j
|jdznd}|tjtj|z|_dS)Nz

r7)__doc__textwrapfilldedent)funtexttems   rfixdocrMs>$'K$;3;C
hod&;&;<<<CKKKr!ctjtjfdt	dt
dtjtjfdt	dt
dt
dtjtjt
zt_t_dS)	z9Install wrappers to always add 30 to the recursion limit.c|rtd	|\}n.#t$r!tdt|dwxYw|dkstd|tzS)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;r]limitsetrecursionlimits   rrz:install_recursionlimit_wrappers.<locals>.setrecursionlimitWs	B@BB
B	=FEE	=	=	=<),T<<<==
=	=qyyACC
C!,,U5I-IJJJs	+Az#            This IDLE wrapper adds z7 to prevent possible
            uninterruptible loops.c<tz
SN)rr)getrecursionlimitsrrz:install_recursionlimit_wrappers.<locals>.getrecursionlimitls ,,..1EEEr!z(            This IDLE wrapper subtracts z# to compensate
            for the z" IDLE adds when setting the limit.N)	functoolswrapsr#rrrr)rrs@@rinstall_recursionlimit_wrappersrSs_S*++KKKK,+K &$8&&&'''_S*++FFFF,+FP)=PP)PPPQQQ
#/114HHIII-C-Cr!c@ttjddrttjddrgtjjt_tjjt_tjtjt
z
dSdSdS)zUninstall the recursion limit wrappers from the sys module.

    IDLE only uses this for tests. Users can import run and call
    this to remove the wrapping.
    rN)getattrr#rrrrrr!r!uninstall_recursionlimit_wrappersr{s
C)=$??NC)=$??N!$ 5 A # 5 Ac3558LLMMMMM
NNNNr!ceZdZdZdS)ric	#t$rt$rdatjYdSt
j}ttj	dddtjjd|d|d	|tjd|	ttj	d
d|datjYdSxYw)zrOverride RPCServer method for IDLE

        Interrupt the MainThread and exit server if link is dropped.

        Tz
            z(----------------------------------------zU
            Unhandled exception in user code execution server!'
            Thread: z"
            IDLE Client Address: z
            Request: r6i)rr'a
            *** 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.
            N)rTEOFErrorrJthreadinterrupt_mainr#rDrCrrrEcurrent_threadr:rWrrS)selfrZclient_addresserfs    rhandle_errorzMyRPCServer.handle_errorsM	$				$	$	$H!######	$.C(/#
##-//4###1	##
###





c4444(/#
## #

$
$
$
$H!######s)CB$CN)r
__module____qualname__rrr!rriris#!$!$!$!$!$r!ric^eZdZd	dZedZedZedZdZdS)
	StdioFileutf-8strictc>||_||_||_||_dSr)shelltags	_encoding_errors)rrrencodingerrorss     r__init__zStdioFile.__init__s"
	!r!c|jSr)rrs rrzStdioFile.encodings
~r!c|jSr)rrs rrzStdioFile.errorss
|r!cd|jzS)Nz<%s>)rrs rr:zStdioFile.names	!!r!cdSNTrrs risattyzStdioFile.isattytr!N)rr)	rrrrpropertyrrr:rrr!rrrsXX""X"r!rceZdZdZdZdS)
StdOutputFilecdSrrrs rwritablezStdOutputFile.writablerr!c|jrtdt||j|j|j|j}|j||j	S)Nzwrite to closed file)
closedrstrencoderrdecoderr%r)rrs  rr%zStdOutputFile.writesb;	53444JJq$-55<<T]DKXXz49---r!N)rrrrr%rr!rrrs2.....r!rc.eZdZdZdZddZddZdZdS)	StdInputFiler7cdSrrrs rreadablezStdInputFile.readablerr!r5c|jrtd|d}n9t|ts$t	dt|jz|j}d|_|dkr<|j	x}r ||z
}|j	x} n`t||kr4|j	}|sn||z
}t||k4||d|_|d|}|S)Nread from closed filer5must be int, not r7r)r	r
isinstancerArr_r_line_bufferrreadliner)rrresultrs    rreadzStdInputFile.reads ;	64555<DDD#&&	G/$t**2EEFFF"!88*--///$
$*--///$
f++$$z**,,"U$f++$$!'tuu
DETE]F
r!c|jrtd|d}n9t|ts$t	dt|jz|jp|j	}|dkrt|}|dd|}|dkr|dz}||d|_|d|S)Nrr5rrrre)r	rrrArr_rrrrrfind)rrreols    rrzStdInputFile.readlines;	64555<DDD#&&	G/$t**2EEFFF 9DJ$7$7$9$9!88t99Diia&&!887D KETE{r!c8|jdSr)rclosers rrzStdInputFile.closes
r!N)r5)rrrrrrrrrr!rrrs_L* r!rc&eZdZdZdZdZdZdS)rjct|}|d||d|_t	|jdt
jt
jt_	t|jdt
jt
jt_t|jdt
jdt_tjt_ddl}|j|_tj	|_t'|d	|_tj|dd
dS)zOverride base methodrconsolestdinstdoutr$backslashreplacerNinterpr=)myseqwait)	Executiveregisterget_remote_proxyr rrrrr#r!rr"r$rdisplayhookpydoc
plainpagerpager_keep_stdinrr$
RPCHandlergetresponse)r	executiver+s   rhandlezMyHandler.handles	dOO	

fi(((,,Y77 w!'&-AA	"4<#)?FMCC
"4<#)?4FHH
/&9')))++H55""4t$"?????r!c.tjddS)z>override SocketIO method - wait for MainThread to shut us down
N)rgrhrs rexithookzMyHandler.exithook!s
2r!c0datjdS)zEOverride SocketIO method - terminate wait on callback and exit threadTNrSrrrs rEOFhookzMyHandler.EOFhook%r!c0datjdS)zinterrupt awakened threadTNr7rs rdecode_interrupthookzMyHandler.decode_interrupthook+r9r!N)rrrr2r5r8r;rr!rrjrjsS@@@4        r!rjc@eZdZdZdZdZdZdZdZdZ	d
d	Z
dS)r'c||_tjdurCtj|_t
j|_tj	|_dSi|_dS)NF)
ridlelibtesting__main____dict__localsrCalltiprAutoComplete)rrs  rrzExecutive.__init__4sQ$?e##"+DK"?,,DL , 9 ; ;DDKKKr!c<	d|_da	t||jdan#dawxYw	t	dS#t
$rz}|jrb|jd}t|tdtfs7tdt|ztj
Yd}~dSYd}~dSYd}~dSd}~wtj|_trt!tjtjurt'nB	tj|jn-#tj|_t'YnxYw|jjd}|r!|jjYdSYdSxYw)NTFrzSystemExit: r6z<<toggle-jit-stack-viewer>>)
user_exc_info
interruptablerrBrrTr;rr_rArCr
r#r$rUrSrK
excepthookrrVrr getvarr$open_remote_stack_viewer)rcodeeobjits     rruncodezExecutive.runcode=s	!%D M
&T4;''' %


%%%%
.
NNNNN-	E	E	Ev
EVAY!"tDzz3&788E.3r772DDDDDDDDDD
E
E
E
E
E
EEEEEEE	B!$D
~!333!!!!&ND$6777&),D&#%%%%%/)001NOOC
B&??AAAAAA
B
B
Bs@	<$<(<
FA#B;;AFD)(F)(EAFc>trtjdSdSr)rGrrrs rinterrupt_the_serverzExecutive.interrupt_the_server^s)	$!#####	$	$r!c6tj|j|Sr)rstart_debuggerr)rgui_adap_oids  rstart_the_debuggerzExecutive.start_the_debuggerbs(,GGGr!c:|j|dS)zDUnregister the Idb Adapter.  Link objects and Idb then subject to GCN)r
unregister)ridb_adap_oids  rstop_the_debuggerzExecutive.stop_the_debuggeres""<00000r!c6|j|Sr)r	fetch_tip)rr:s  rget_the_calltipzExecutive.get_the_calltipis|%%d+++r!c8|j||Sr)rfetch_completions)rwhatmodes   rget_the_completion_listz!Executive.get_the_completion_listls 224>>>r!Nc.|jr|j\}}}ndSd}||j|}|r1|jjddvr|j}|r|jjddv||_tj||}tj
|S)Nr)rrun)rFrr)tb_frame	f_globalstb_nextrr	
StackTreeItemrremote_object_tree_item)r	flist_oid_rraflistitems       rr	zExecutive.stackvieweros	+JAsBB4 O44Y??E	R[*:6.HHB	R[*:6.HH(e441$777r!r)rrrrrOrQrUrYr\rar	rr!rr'r'2sB$$$HHH111,,,???888888r!r'r@)rbzidlelib.idle_test.test_run)	verbosityr)NN)F)CrrrrrrOr#rrgrW_threadrrEr+r>rrrrrrr	r@rvhasattrmodulesmoddelattrr
rHeofrKquitrr r(r*r.Tclr2r3rJrSrGrbrGrkrrVrrryrrrr	RPCServerri
TextIOBaserrrr/rjr'runittestrr!r<module>rzsx				



      ws{=):660**	K
S())*/CK
'		
 CDHDHH			D	



>B



)))gkmm
LLLL\&"	9	9	9"""H!!!>"""	1	1	1===%.%.%.PNNN#$#$#$#$#$#-#$#$#$P
0	.	.	.	.	.I	.	.	.,,,,,9,,,^* * * * * * * * ZI8I8I8I8I8I8I8I8XzD	%3333s1CC
	C