wrap dict with list() in for loop
In python 3, if the dict is changed in the loop, there will be following error: RuntimeError: dictionary changed size during iteration Tranfrom dict with list() to fix it. Partial implements: blueprint py33-support Change-Id: I4b9f5bc083ebe62739a33674d26728d4a8f1a2d6
This commit is contained in:
@@ -392,7 +392,7 @@ class HttpVersionNotSupported(HttpServerError):
|
||||
# _code_map = dict((c.http_status, c)
|
||||
# for c in HttpError.__subclasses__())
|
||||
_code_map = {}
|
||||
for obj in sys.modules[__name__].__dict__.values():
|
||||
for obj in list(sys.modules[__name__].__dict__.values()):
|
||||
if isinstance(obj, type):
|
||||
try:
|
||||
http_status = obj.http_status
|
||||
|
Reference in New Issue
Block a user