summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-03-18 17:24:55 +0100
committerVictor Stinner <victor.stinner@gmail.com>2014-03-18 17:24:55 +0100
commitf863227e7881492e14b5361f6cccdc857210f64f (patch)
treebaf3149076b6511ab0069138ab800ebf213e8b12
parentd83aa177e286a50e3e50c6d4575df883c70de849 (diff)
downloadpaste-git-f863227e7881492e14b5361f6cccdc857210f64f.tar.gz
Copy the dictionary of global variables to be able to iterate over it and
modify global variables
-rw-r--r--paste/httpexceptions.py2
-rw-r--r--paste/httpheaders.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/paste/httpexceptions.py b/paste/httpexceptions.py
index 2c0c020..492f558 100644
--- a/paste/httpexceptions.py
+++ b/paste/httpexceptions.py
@@ -587,7 +587,7 @@ class HTTPVersionNotSupported(HTTPServerError):
__all__ = ['HTTPException', 'HTTPRedirection', 'HTTPError' ]
_exceptions = {}
-for name, value in six.iteritems(globals()):
+for name, value in six.iteritems(dict(globals())):
if (isinstance(value, (type, six.class_types)) and
issubclass(value, HTTPException) and
value.code):
diff --git a/paste/httpheaders.py b/paste/httpheaders.py
index 7c57c29..702e596 100644
--- a/paste/httpheaders.py
+++ b/paste/httpheaders.py
@@ -136,6 +136,7 @@ dashes to give CamelCase style names.
"""
import mimetypes
import re
+import six
from time import time as now
try:
# Python 3
@@ -171,7 +172,7 @@ REQUEST_METHOD = EnvironVariable("REQUEST_METHOD")
SCRIPT_NAME = EnvironVariable("SCRIPT_NAME")
PATH_INFO = EnvironVariable("PATH_INFO")
-for _name, _obj in six.iteritems(globals()):
+for _name, _obj in six.iteritems(dict(globals())):
if isinstance(_obj, EnvironVariable):
__all__.append(_name)
@@ -1099,6 +1100,6 @@ for head in _headers.values():
__all__.append(headname)
__pudge_all__ = __all__[:]
-for _name, _obj in six.iteritems(globals()):
+for _name, _obj in six.iteritems(dict(globals())):
if isinstance(_obj, type) and issubclass(_obj, HTTPHeader):
__pudge_all__.append(_name)