Exemplo n.º 1
0
def run_and_check (run_client):
    w = run_interaction(run_client = run_client)
    clear_sys_exc_info()
    if w():
        print pformat(gc.get_referrers(w()))
        for x in gc.get_referrers(w()):
            print pformat(x)
            for y in gc.get_referrers(x):
                print '-', pformat(y)
        raise AssertionError('server should be dead by now')
Exemplo n.º 2
0
Arquivo: hub.py Projeto: inercia/evy
 def switch (self):
     """
     Switches to a different greenlet
     :return:
     :rtype:
     """
     cur = greenlet.getcurrent()
     assert cur is not self.greenlet, 'Cannot switch to MAINLOOP from MAINLOOP'
     switch_out = getattr(cur, 'switch_out', None)
     if switch_out is not None:
         try:
             switch_out()
         except:
             self.squelch_generic_exception(sys.exc_info())
     self.ensure_greenlet()
     try:
         if self.greenlet.parent is not cur:
             cur.parent = self.greenlet
     except ValueError:
         pass  # gets raised if there is a greenlet parent cycle
     clear_sys_exc_info()
     return self.greenlet.switch()
Exemplo n.º 3
0
Arquivo: hub.py Projeto: PlumpMath/evy
 def switch(self):
     """
     Switches to a different greenlet
     :return:
     :rtype:
     """
     cur = greenlet.getcurrent()
     assert cur is not self.greenlet, 'Cannot switch to MAINLOOP from MAINLOOP'
     switch_out = getattr(cur, 'switch_out', None)
     if switch_out is not None:
         try:
             switch_out()
         except:
             self.squelch_generic_exception(sys.exc_info())
     self.ensure_greenlet()
     try:
         if self.greenlet.parent is not cur:
             cur.parent = self.greenlet
     except ValueError:
         pass  # gets raised if there is a greenlet parent cycle
     clear_sys_exc_info()
     return self.greenlet.switch()
Exemplo n.º 4
0
Arquivo: hub.py Projeto: inercia/evy
 def squelch_exception (self, exc_info):
     if self.debug_exceptions:
         traceback.print_exception(*exc_info)
         sys.stderr.flush()
         clear_sys_exc_info()
Exemplo n.º 5
0
Arquivo: hub.py Projeto: PlumpMath/evy
 def squelch_exception(self, exc_info):
     if self.debug_exceptions:
         traceback.print_exception(*exc_info)
         sys.stderr.flush()
         clear_sys_exc_info()