move sys.argv fix to better place
authorThomas Waldmann <tw AT waldmann-edv DOT de>
Mon, 18 Jan 2010 23:05:58 +0100
changeset 54619d8e7ce3c3a2
parent 5460 44c165260367
child 5462 d96be1d8f247
move sys.argv fix to better place
MoinMoin/web/flup_frontend.py
wiki/server/moin.cgi
     1.1 --- a/MoinMoin/web/flup_frontend.py	Mon Jan 18 22:40:49 2010 +0100
     1.2 +++ b/MoinMoin/web/flup_frontend.py	Mon Jan 18 23:05:58 2010 +0100
     1.3 @@ -129,6 +129,11 @@
     1.4          if have_singlepatch:
     1.5              server_types['single'] = 'flup.server.fcgi_single'
     1.6  
     1.7 +        def run(self, args=None):
     1.8 +            if 'GATEWAY_INTERFACE' in os.environ:
     1.9 +                sys.argv = []
    1.10 +            super(CGIFrontEnd, self).run(args)
    1.11 +
    1.12      class SCGIFrontEnd(FlupFrontEnd):
    1.13          server_types = {'threaded': 'flup.server.scgi',
    1.14                          'forking': 'flup.server.scgi_fork'}
    1.15 @@ -144,6 +149,11 @@
    1.16                              "support is available.")
    1.17              super(CGIFrontEnd, self).__init__()
    1.18  
    1.19 +        def run(self, args=None):
    1.20 +            if 'GATEWAY_INTERFACE' in os.environ:
    1.21 +                sys.argv = []
    1.22 +            super(CGIFrontEnd, self).run(args)
    1.23 +
    1.24          def run_server(self, application, options):
    1.25              from MoinMoin.web._fallback_cgi import WSGIServer
    1.26              return WSGIServer(application).run()
     2.1 --- a/wiki/server/moin.cgi	Mon Jan 18 22:40:49 2010 +0100
     2.2 +++ b/wiki/server/moin.cgi	Mon Jan 18 23:05:58 2010 +0100
     2.3 @@ -34,9 +34,6 @@
     2.4  # this works around a bug in flup's CGI autodetection (as of flup 1.0.1):
     2.5  os.environ['FCGI_FORCE_CGI'] = 'Y' # 'Y' for (slow) CGI, 'N' for FCGI
     2.6  
     2.7 -if 'GATEWAY_INTERFACE' in os.environ:
     2.8 -    sys.argv = []
     2.9 -
    2.10  from MoinMoin.web.flup_frontend import CGIFrontEnd
    2.11  CGIFrontEnd().run()
    2.12