~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/dispatch/__init__.py

  • Committer: mattgiuca
  • Date: 2008-02-24 23:55:53 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:558
dispatch: Fixed error on some setups from trying to read admin email.
    (mod_python interface is broken -- hack around it).

Show diffs side-by-side

added added

removed removed

Lines of Context:
170
170
    the IVLE request is created.
171
171
    """
172
172
    req.content_type = "text/html"
173
 
    admin_email = apache._server.server_admin
 
173
    # For some reason, some versions of mod_python have "_server" instead of
 
174
    # "main_server". So we check for both.
 
175
    try:
 
176
        admin_email = apache.main_server.server_admin
 
177
    except AttributeError:
 
178
        try:
 
179
            admin_email = apache._server.server_admin
 
180
        except AttributeError:
 
181
            admin_email = ""
174
182
    try:
175
183
        httpcode = exc_value.httpcode
176
184
        req.status = httpcode