Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1702

Show
Ignore:
Timestamp:
08/19/07 15:55:32
Author:
fumanchu
Message:

3.0.x fix: test_states was failing because engine.restart was calling signal.signal in a thread other than the main thread.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-3.0.x/cherrypy/_cpengine.py

    r1635 r1702  
    293293     
    294294    def _set_signals(self): 
    295         if self.SIGHUP: 
    296             signal.signal(signal.SIGHUP, self.SIGHUP) 
    297         if self.SIGTERM: 
    298             signal.signal(signal.SIGTERM, self.SIGTERM) 
    299      
     295        try: 
     296            if self.SIGHUP: 
     297                signal.signal(signal.SIGHUP, self.SIGHUP) 
     298            if self.SIGTERM: 
     299                signal.signal(signal.SIGTERM, self.SIGTERM) 
     300        except ValueError, x: 
     301            if x.args[0] != 'signal only works in main thread': 
     302                raise 
    300303     
    301304    #                           Drop privileges                           # 

Hosted by WebFaction

Log in as guest/cpguest to create tickets