all.  Im just tring to get web.py work with the help of spawn-fcgi with yaws. But I encountered a problem:

<server localhost>
        port = 80
        listen =
        appmods = </test, yaws_appmod_fcgi>
        docroot = /usr/local/var/yaws/www
        fcgi_app_server =
        fcgi_trace_protocol = true

#!/usr/bin/env python
import web

urls = ("/.*", "hello")
app = web.application(urls, globals())

class hello:
    def GET(self):
        return 'Hello, world!'

if __name__ == '__main__':
    web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr)

run spawn-fcgi:
spawn-fcgi -d /root/test -f /root/test/index.py -a -p 3000

but when I visited http://localhost/test, it returned a blank page with 200.
Then I modified the index.py, remove the if __name__ == '__main__':

visited again, returned an exception: 

<type 'exceptions.ValueError'> at /apps/testapp

signal only works in main thread

Im new to fcgi, so turn to maillist for help after searching the whole Internet without getting anything.

Thank in advance..

Best wishes,

Tan Menglong