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

Changeset 711

Show
Ignore:
Timestamp:
10/03/05 12:23:23
Author:
fumanchu
Message:

autoreload now calls server.stop() on interrupt. No test for it though. :(

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cpserver.py

    r709 r711  
    9999                except KeyboardInterrupt: 
    100100                    cherrypy.log("<Ctrl-C> hit: shutting down autoreloader", "HTTP") 
     101                    self.stop() 
     102                except SystemExit: 
     103                    cherrypy.log("SystemExit raised: shutting down autoreloader", "HTTP") 
     104                    self.stop() 
    101105                return 
    102106         
  • trunk/cherrypy/lib/autoreload.py

    r661 r711  
    3939        new_environ = os.environ.copy() 
    4040        new_environ["RUN_MAIN"] = 'true' 
    41         exit_code = os.spawnve(os.P_WAIT, sys.executable, 
    42                                args, new_environ) 
     41        exit_code = os.spawnve(os.P_WAIT, sys.executable, args, new_environ) 
    4342        if exit_code != 3: 
    4443            return exit_code 
     
    5352        thread.start_new_thread(main_func, args, kwargs) 
    5453         
    55         try: 
    56             reloader_thread() 
    57         except KeyboardInterrupt: 
    58             pass 
     54        # If KeyboardInterrupt is raised within reloader_thread, 
     55        # let it propagate out to the caller. 
     56        reloader_thread() 
    5957    else: 
    6058        # If KeyboardInterrupt is raised within restart_with_reloader, 

Hosted by WebFaction

Log in as guest/cpguest to create tickets