summaryrefslogtreecommitdiff
path: root/paste/errordocument.py
diff options
context:
space:
mode:
authorbbangert <devnull@localhost>2006-06-03 00:31:41 +0000
committerbbangert <devnull@localhost>2006-06-03 00:31:41 +0000
commit5b02061b69a69cbe10ff6cb717d0f49d50269af7 (patch)
tree2e4f3d6f2d09b2892d88d1670107ef4153193f54 /paste/errordocument.py
parent00ac4e80a50220f69578a81948d40575c3eeb2ea (diff)
downloadpaste-5b02061b69a69cbe10ff6cb717d0f49d50269af7.tar.gz
Fixing default {}, since it will always be retained. Creating a {} for each call where its not passed.
Diffstat (limited to 'paste/errordocument.py')
-rw-r--r--paste/errordocument.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/paste/errordocument.py b/paste/errordocument.py
index fce1efb..20e4b0c 100644
--- a/paste/errordocument.py
+++ b/paste/errordocument.py
@@ -100,7 +100,7 @@ def forward(app, codes):
return None
return _StatusBasedRedirect(app, error_codes_mapper, codes=codes)
-def custom_forward(app, mapper, global_conf={}, **kw):
+def custom_forward(app, mapper, global_conf=None, **kw):
"""
Intercepts a response with a particular status code and returns the
content from the URL specified by a user-defined mapper object
@@ -177,6 +177,8 @@ def custom_forward(app, mapper, global_conf={}, **kw):
return None
return custom_forward(app, error_codes_mapper, codes=codes)
"""
+ if global_conf is None:
+ global_conf = {}
return _StatusBasedRedirect(app, mapper, global_conf, **kw)
class _StatusBasedRedirect:
@@ -185,7 +187,9 @@ class _StatusBasedRedirect:
the documentation for ``error_document_mapper`` for details or
``error_document_redirect()`` for an different example of its use.
"""
- def __init__(self, app, mapper, global_conf={}, **kw):
+ def __init__(self, app, mapper, global_conf=None, **kw):
+ if global_conf is None:
+ global_conf = {}
self.application = app
self.mapper = mapper
self.global_conf = global_conf