changeset 5461:9d8e7ce3c3a2

move sys.argv fix to better place
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 18 Jan 2010 23:05:58 +0100
parents 44c165260367
children d96be1d8f247
files MoinMoin/web/flup_frontend.py wiki/server/moin.cgi
diffstat 2 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/web/flup_frontend.py	Mon Jan 18 22:40:49 2010 +0100
+++ b/MoinMoin/web/flup_frontend.py	Mon Jan 18 23:05:58 2010 +0100
@@ -129,6 +129,11 @@
         if have_singlepatch:
             server_types['single'] = 'flup.server.fcgi_single'
 
+        def run(self, args=None):
+            if 'GATEWAY_INTERFACE' in os.environ:
+                sys.argv = []
+            super(CGIFrontEnd, self).run(args)
+
     class SCGIFrontEnd(FlupFrontEnd):
         server_types = {'threaded': 'flup.server.scgi',
                         'forking': 'flup.server.scgi_fork'}
@@ -144,6 +149,11 @@
                             "support is available.")
             super(CGIFrontEnd, self).__init__()
 
+        def run(self, args=None):
+            if 'GATEWAY_INTERFACE' in os.environ:
+                sys.argv = []
+            super(CGIFrontEnd, self).run(args)
+
         def run_server(self, application, options):
             from MoinMoin.web._fallback_cgi import WSGIServer
             return WSGIServer(application).run()
--- a/wiki/server/moin.cgi	Mon Jan 18 22:40:49 2010 +0100
+++ b/wiki/server/moin.cgi	Mon Jan 18 23:05:58 2010 +0100
@@ -34,9 +34,6 @@
 # this works around a bug in flup's CGI autodetection (as of flup 1.0.1):
 os.environ['FCGI_FORCE_CGI'] = 'Y' # 'Y' for (slow) CGI, 'N' for FCGI
 
-if 'GATEWAY_INTERFACE' in os.environ:
-    sys.argv = []
-
 from MoinMoin.web.flup_frontend import CGIFrontEnd
 CGIFrontEnd().run()