> 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: ||||||||||||||||||||||||||||||||||||||||||||||| -- http://mail.python.org/mailman/listinfo/python-list