Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
debug.cpython-313.pyc63 linesDownload Raw Back to __pycache__
1�

2��j��3�\�SSKrSSKrSSKJr SSKJr SSKJr SSKJ	r	 SSKJ4r5 \R(aSSKJ
r
 SS	\R\S6\4SjjrS\S
\R\S\S\S7\48SjrS\R(\\R*4S9\R,\\R*44Sjrg)�N)�CodeType)�
TracebackType�)�TemplateSyntaxError)�
internal_code)�missing)�Context�source�returnc�n�[R"5upn[R"[U5n[R"[10U5n[
U[5(a[UR(dJSUlXl	URS5 [USUR=(d SUR5nOURn/nUb�URR [";aURnM/URR$R'S5nUbDUR)UR*5n[X#URU5nUR-U5 OUR-U5 URnUbM�Sn[/U5HnX�lUnM
 URU5$)a\Rewrite the current exception to replace any tracebacks from11within compiled template code with tracebacks that look like they12came from the template source.13 14This must be called within an ``except`` block.15 16:param source: For ``TemplateSyntaxError``, the original source if17    known.18:return: The original exception with the rewritten traceback.19TNz	<unknown>�__jinja_template__)�sys�exc_info�t�cast�
BaseExceptionr�20isinstancer�21translatedr22�with_traceback�fake_traceback�filename�lineno�tb_next�tb_frame�f_coder�	f_globals�get�get_corresponding_lineno�	tb_lineno�append�reversed)	r23�_�	exc_value�tb�stack�templater�fake_tbrs	         �RD:\code\apps\devtools\python\user_packages\Python313\site-packages\jinja2/debug.py�rewrite_traceback_stackr)sj���|�|�~��A�"����}�i�0�I�	24���
�r�	"�B��)�0�1�1�)�:N�:N�#�	��!��	� � ��&���t�Y�/�/�>�;�	�@P�@P�25��26�Z�Z���E�
�.��;�;����.����B���;�;�(�(�,�,�-A�B�����6�6�r�|�|�D�F�$�Y�H�4E�4E�v�N�G��L�L��!��L�L���
�Z�Z��!
�.�$�G��u�o���27�����#�#�G�,�,�r#r$rrc�T�Ub2[URR5nURSS5 O0nUUUS.n[	SUS-28-S-US5nSnUbHURR29RnUS	:XaS30nOURS5(a	SUS
S<3n[RS:�aURUS9nO�[URURURURUR UR"UR$UR&UR(UR*UUR,UR.UR0UR25n[5XeU5 g![6a% [R8"5SR:s$f=f)aProduce a new traceback object that looks like it came from the31template source instead of the compiled code. The filename, line32number, and location name will point to the template, and the local33variables will be the current template context.34 35:param exc_value: The original exception to be re-raised to create36    the new traceback.37:param tb: The original traceback to get the local variables and38    code info from.39:param filename: The template filename.40:param lineno: The line number in the template source.41N�__jinja_exception__)�__name__�__file__r,�42rzraise __jinja_exception__�execr&�rootztop-level template code�block_zblock �)��)�co_name�)�get_template_localsr�f_locals�pop�compilerr6�43startswithr�version_info�replacer�co_argcount�co_kwonlyargcount�44co_nlocals�co_stacksize�co_flags�co_code�	co_consts�co_names�co_varnames�co_filename�co_firstlineno�	co_lnotab�co_freevars�co_cellvarsr0rrr)	r#r$rr�locals�globals�code�location�functions	         r(rrLs���45�~�%�R�[�[�%9�%9�:���46�47�(�$�/�����(��G�����48��9�9�8�V��D��H�	�~��;�;�%�%�-�-���v��0�H�
�
 �
 ��
*�
*������/�0�H�49���6�!��|�|�H�|�-�������"�"��O�O�����M�M��L�L��N�N��M�M������������N�N�������50��()��T�F�#���)��|�|�~�a� �(�(�(�)�s�+E8�8,F'�&F'�real_localsc��URS5nUbUR5R5nO0n0nUR5HhupEUR	S5(a	U[51LaM&UR
SS5upgn[U5nURUS5Sn	X�:dMcX�4X4'Mj UR5H)unupeU[52LaURUS5 M%XRU'M+ U$![a M�f=f)zdBased on the runtime locals, get the context that would be53available at that point in the template.54�contextN�l_r"r7)�����r)55r�get_all�copy�itemsr<r�split�int�56ValueErrorr:)57rR�ctx�data�local_overrides�name�valuer"�	depth_str�depth�	cur_depths58          r(r8r8�s��59 +���y�9�C�60��#&�;�;�=�#5�#5�#7����9;�O�"�(�(�*������t�$�$���(8��	�!%���C��!3��A�$��	�N�E�$�'�'��e�4�Q�7�	���%*�N�O�!�+�",�1�1�3���j�q��G���H�H�T�4� ���J�	4��K���	��	�s�/ C3�361D�D)N)r�typingr�typesrr�62exceptionsr�utilsrr�
TYPE_CHECKING�runtimer	�Optional�strrr)r[r�Mapping�Any�Dictr8�r*r(�<module>rqs���63����+� ���?�?� �;-�A�J�J�s�O�;-�}�;-�|G)��G)�"#�*�*�]�";�G)�GJ�G)�TW�G)��G)�T)�Q�Y�Y�s�A�E�E�z�%:�)�q�v�v�c�1�5�5�j�?Q�)r*
codekingpro/portable-devtools · Team Ai