}BFjlvdZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ddl mZd ad Zd Zd ZdS) aGlobal IPython app to support test running. We must start our own ipython object and heavily muck with it so that all the modifications IPython makes to system behavior don't send the doctest machinery into a fit. This code should be considered a gross hack, but it gets the job done. N)Path)tools)page)io)TerminalInteractiveShellctS)N) start_ipythonIC:\PYTHON\_runtimes\venv\Lib\site-packages\IPython/testing/globalipapp.py get_ipythonrs ??r ct||dddtjtjdS)zFReplace the default system call with a capturing one for doctest. Fr)splitdepth)endfileN)print getoutputrstripsysstdoutflush)selfcmds r xsysr"sS  $..E. 3 3 : : < <"3:VVVVJr clt|j|tjdS)zDPrint the traceback purely on stdout for doctest to capture it. )rN)r InteractiveTBstb2textrr)retypeevaluestbs r _showtracebackr$+s0 $  % %c * *<<<<<.nopagejs6 eT " " /99\2..5 e r )rrN) hasattrr r&r displayhook excepthookmodulesr,rdefault_configr simple_promptinstance tempfilesappendrHistoryManager hist_file builtin_trapactivatetypes MethodTypersystemr$r builtin_mod_ipipr pager_page orig_page) _displayhook _excepthook_mainr(shellrCr1s r r r 1sP }.//#'M ?L.K KOOJ ' 'E ! # #F48F#1 % -V 0 0 0E  O4 5 ?@@AAA !!! #D%00EL +NEBBE $CK "CO CN C/KKOKN)K _DNDO Jr )__doc__builtinsrBrr?pathlibrrr IPython.corer IPython.utilsr!IPython.terminal.interactiveshellrrrr$r r r r rQs FFFFFF=== AAAAAr