コード例 #1
0
ファイル: hub.py プロジェクト: bigmlcom/pylibs
 def switch(self):
     cur = getcurrent()
     assert cur is not self, 'Cannot switch to MAINLOOP from MAINLOOP'
     switch_out = getattr(cur, 'switch_out', None)
     if switch_out is not None:
         try:
             switch_out()
         except:
             traceback.print_exc()
     return greenlet.switch(self)
コード例 #2
0
ファイル: hub.py プロジェクト: OYZQ/odoo_qingjia
 def switch(self):
     exc_type, exc_value = sys.exc_info()[:2]
     try:
         switch_out = getattr(getcurrent(), 'switch_out', None)
         if switch_out is not None:
             switch_out()
         exc_clear()
         return greenlet.switch(self)
     finally:
         set_exc_info(exc_type, exc_value)
コード例 #3
0
ファイル: hub.py プロジェクト: HVF/gevent
 def switch(self):
     exc_type, exc_value = sys.exc_info()[:2]
     try:
         switch_out = getattr(getcurrent(), 'switch_out', None)
         if switch_out is not None:
             switch_out()
         exc_clear()
         return greenlet.switch(self)
     finally:
         core.set_exc_info(exc_type, exc_value)
コード例 #4
0
ファイル: hub.py プロジェクト: SMFOSS/gevent
 def switch(self):
     cur = getcurrent()
     assert cur is not self, 'Cannot switch to MAINLOOP from MAINLOOP'
     exc_info = sys.exc_info()
     try:
         sys.exc_clear()
         switch_out = getattr(cur, 'switch_out', None)
         if switch_out is not None:
             try:
                 switch_out()
             except:
                 traceback.print_exc()
         return greenlet.switch(self)
     finally:
         core.set_exc_info(*exc_info)
コード例 #5
0
 def switch(self):
     cur = getcurrent()
     assert cur is not self, 'Cannot switch to MAINLOOP from MAINLOOP'
     exc_type, exc_value = sys.exc_info()[:2]
     try:
         switch_out = getattr(cur, 'switch_out', None)
         if switch_out is not None:
             try:
                 switch_out()
             except:
                 traceback.print_exc()
         sys.exc_clear()
         return greenlet.switch(self)
     finally:
         core.set_exc_info(exc_type, exc_value)
コード例 #6
0
ファイル: hub.py プロジェクト: newbrough/gevent-0.13.7
 def switch(self):
     trace = sys.gettrace()
     sys.settrace(None)
     cur = getcurrent()
     assert cur is not self, 'Cannot switch to MAINLOOP from MAINLOOP'
     exc_type, exc_value = sys.exc_info()[:2]
     try:
         switch_out = getattr(cur, 'switch_out', None)
         if switch_out is not None:
             try:
                 switch_out()
             except:
                 traceback.print_exc()
         sys.exc_clear()
         return greenlet.switch(self)
     finally:
         core.set_exc_info(exc_type, exc_value)
         sys.settrace(trace)
コード例 #7
0
ファイル: hub.py プロジェクト: HVF/gevent
 def _start(self):
     try:
         greenlet = self.greenlet_class(self.handle)
         greenlet.switch()
     except:
         self.hub.handle_error(None, *sys._exc_info())
コード例 #8
0
ファイル: hub.py プロジェクト: OYZQ/odoo_qingjia
 def _start(self):
     try:
         greenlet = self.greenlet_class(self.handle)
         greenlet.switch()
     except:
         self.hub.handle_error(None, *sys._exc_info())