a mIž[Ÿã@sˆdZddlZddlmZGdd„deƒZGdd„deƒZGdd „d eƒZGd d „d eƒZ erfd d „Z ne dƒde _dd„Z dd„Z dS)zt Standardized versions of various cool and/or strange things that you can do with Python's reflection capabilities. éN)ÚPY3c@seZdZdZdS)Ú_NoModuleFoundz2 No module was found because none exists. N©Ú__name__Ú __module__Ú __qualname__Ú__doc__©r r ú7/usr/lib/python3.9/site-packages/jsonschema/_reflect.pyrsrc@seZdZdZdS)Ú InvalidNamezG The given name is not a dot-separated list of Python objects. Nrr r r r r sr c@seZdZdZdS)ÚModuleNotFoundz_ The module associated with the given name doesn't exist and it can't be imported. Nrr r r r r sr c@seZdZdZdS)ÚObjectNotFoundz_ The object associated with the given name doesn't exist and it can't be imported. Nrr r r r r %sr cCs| |¡‚dS)N)Úwith_traceback)Ú exceptionÚ tracebackr r r Úreraise.srzZdef 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. cCshz t|ƒWStybt ¡\}}}|rX|jjd}|dusF||krPt||ƒ|j}q&tƒ‚Yn0dS)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. rN) Ú __import__Ú ImportErrorÚsysÚexc_infoÚtb_frameÚ f_globalsrÚtb_nextr)Z importNameZexcTypeZexcValueZ excTracebackZexecNamer r r Ú_importAndCheckStack@s    rcCsÈ|s tdƒ‚| d¡}d|vr,td|fƒ‚d}|dd…}|s¤|rxd |¡}z t|ƒ}Wq¢tyt| ¡Yq¢0qs