관리-도구
편집 파일: _reflect.cpython-311.pyc
� �܋f� � �� � d Z ddlZddlmZ G d� de� � Z G d� de� � Z G d� d e� � Z G d � de� � Z erd� Z n ed � � de _ d� Zd� Z dS )zt Standardized versions of various cool and/or strange things that you can do with Python's reflection capabilities. � N)�PY3c � � e Zd ZdZdS )�_NoModuleFoundz2 No module was found because none exists. N��__name__� __module__�__qualname__�__doc__� � �d/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/jsonschema/_reflect.pyr r � � � � � � �� � � r r c � � e Zd ZdZdS )�InvalidNamezG The given name is not a dot-separated list of Python objects. Nr r r r r r r r r c � � e Zd ZdZdS )�ModuleNotFoundz_ The module associated with the given name doesn't exist and it can't be imported. Nr r r r r r � � � � � � �� � � r r c � � e Zd ZdZdS )�ObjectNotFoundz_ The object associated with the given name doesn't exist and it can't be imported. Nr r r r r r % r r r c �, � | � |� � �)N)�with_traceback)� exception� tracebacks r �reraiser . s � ��&�&�y�1�1�1r zZdef reraise(exception, traceback): raise exception.__class__, exception, tracebackaZ Re-raise an exception, with an optional traceback, in a way that is compatible with both Python 2 and Python 3. Note that on Python 3, re-raised exceptions will be mutated, with their C{__traceback__} attribute being set. @param exception: The exception instance. @param traceback: The traceback to use, or C{None} indicating a new traceback. c �� � t | � � S # t $ r[ t j � � \ }}}|r3|j j d }|�|| k rt ||� � |j }|�3t � � �w xY w)a� Import the given name as a module, then walk the stack to determine whether the failure was the module not existing, or some code in the module (for example a dependent import) failing. This can be helpful to determine whether any actual application code was run. For example, to distiguish administrative error (entering the wrong module name), from programmer error (writing buggy code in a module that fails to import). @param importName: The name of the module to import. @type importName: C{str} @raise Exception: if something bad happens. This can be any type of exception, since nobody knows what loading some arbitrary code might do. @raise _NoModuleFound: if no module was found. r ) � __import__�ImportError�sys�exc_info�tb_frame� f_globalsr �tb_nextr )� importName�excType�excValue�excTraceback�execNames r �_importAndCheckStackr( @ s� � � ��*�%�%�%��� � � �*-�,�.�.�'���<�� 0�#�,�6�z�B�H� ��8�z�#9�#9���,�/�/�/�'�/�L� � 0� ���� ���s � �A%A6c �� � | st d� � �| � d� � }d|v rt d| ��� � �d}|dd� }|s�|rJd� |� � } t |� � }n[# t $ r |� � � Y n;w xY wt |� � dk rt d| ��� � �t | �d�� � �|��|}|dd� D ]}t ||� � }�|S ) a� Retrieve a Python object by its fully qualified name from the global Python module namespace. The first part of the name, that describes a module, will be discovered and imported. Each subsequent part of the name is treated as the name of an attribute of the object specified by all of the name which came before it. For example, the fully-qualified name of this object is 'twisted.python.reflect.namedAny'. @type name: L{str} @param name: The name of the object to return. @raise InvalidName: If the name is an empty string, starts or ends with a '.', or is otherwise syntactically incorrect. @raise ModuleNotFound: If the name is syntactically correct but the module it specifies cannot be imported because it does not appear to exist. @raise ObjectNotFound: If the name is syntactically correct, includes at least one '.', but the module it specifies cannot be imported because it does not appear to exist. @raise AttributeError: If an attribute of an object along the way cannot be accessed, or a module along the way is not found. @return: the Python object identified by 'name'. zEmpty module name�.� zMname must be a string giving a '.'-separated list of Python identifiers, not N� zNo module named z does not name an object) r �split�joinr( r �pop�lenr r �getattr)�name�names�topLevelPackage�moduleNames� trialname�obj�ns r �namedAnyr9 _ sG � �8 � /��-�.�.�.��J�J�s�O�O�E� �U�{�{��k�%)�T� ,�-� -� -� �O�����(�K�� M�� M�����-�-�I� "�"6�y�"A�"A����!� "� "� "����!�!�!�!�!� "���� �5�z�z�Q���$�n�T�T�%C�D�D�D�$�T�T�T�%K�L�L�L� � M� �C� �1�2�2�Y� � ���c�1�o�o����Js �#A3 �3B�B)r r �jsonschema.compatr � Exceptionr � ValueErrorr r r r �execr( r9 r r r �<module>r>