SCGIServer and unusal termination

Дамјан Георгиевски gdamjan at gmail.com
Thu Nov 19 16:45:16 CET 2009


> everything works just fine, but one thing bothers me. All prints after
> try-except block are executed twice after the Ctrl+C is pressed!
> 
> test.py:
> #-------------------------
> from scgi.scgi_server import SCGIServer
> 
> n = 0
> print "Starting server."
> 
> try:
>      SCGIServer().serve()
> except (KeyboardInterrupt, SystemExit):
>      print "Exception!"
> 
> # print lines are executed twice (?!)
> n += 1
> print "Terminating server, attempt %d." % n
> n += 1
> print "Check n: %d." % n
> #-------------------------

SCGIServer().serve() forks, so it seems that there are 2 python 
processes continuing to run after SCGIServer().serve()


-- 
дамјан ((( http://damjan.softver.org.mk/ )))

Spammers scratch here with a diamond to find my address:
|||||||||||||||||||||||||||||||||||||||||||||||



More information about the Python-list mailing list