ϪfXdZddgZddlZddlZddlmZGddeZGddeZy)z/ Testing helpers related to the module system. NoReactorAlternateReactorN)SetAsideModulec"eZdZdZdZdZdZy)rzc Context manager that uninstalls the reactor, if any, and then restores it afterwards. c0tj|dyNztwisted.internet.reactor)r__init__selfs E/usr/lib/python3/dist-packages/twisted/internet/test/modulehelpers.pyr zNoReactor.__init__s&@Acltj|d|jvrtj`yyr)r __enter__modulestwistedinternetreactorr s r rzNoReactor.__enter__s-  & % 5  ( 6r ctj|||||jjdd}||tj _y tj `y#t$rYywxYwr)r__exit__rgetrrrAttributeError)r excTypeexcValue tracebackrs r rzNoReactor.__exit__sfgxC,,""#=tD  '.G   $ $$,!  sA A+*A+N)__name__ __module__ __qualname____doc__r rrr r rrs B) r ceZdZdZdZdZy)rzd A context manager which temporarily installs a different object as the global reactor. c<tj|||_y)zN @param reactor: Any object to install as the global reactor. N)rr alternate)r rs r r zAlternateReactor.__init__3s 4  r ctj||jtj_|jt jd<yr)rrr"rrrsysrr s r rzAlternateReactor.__enter__:s5D!#'>> 26.. ./r N)rrrrr rrr r rr-s !Ar ) r__all__r$twisted.internetrtwisted.test.test_twistedrrrrr r r(s: * + 48AyAr