forked from orbit-oss/flask
python-modernize automated changes: fix_dict
This commit is contained in:
parent
cfbfff2d26
commit
0f8c47c988
2 changed files with 5 additions and 3 deletions
|
|
@ -17,6 +17,7 @@ from werkzeug.datastructures import CallbackDict
|
|||
from . import Markup, json
|
||||
|
||||
from itsdangerous import URLSafeTimedSerializer, BadSignature
|
||||
import six
|
||||
|
||||
|
||||
def total_seconds(td):
|
||||
|
|
@ -68,7 +69,7 @@ class TaggedJSONSerializer(object):
|
|||
elif isinstance(value, datetime):
|
||||
return {' d': http_date(value)}
|
||||
elif isinstance(value, dict):
|
||||
return dict((k, _tag(v)) for k, v in value.iteritems())
|
||||
return dict((k, _tag(v)) for k, v in six.iteritems(value))
|
||||
elif isinstance(value, str):
|
||||
try:
|
||||
return unicode(value)
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ from jinja2 import BaseLoader, Environment as BaseEnvironment, \
|
|||
from .globals import _request_ctx_stack, _app_ctx_stack
|
||||
from .signals import template_rendered
|
||||
from .module import blueprint_is_module
|
||||
import six
|
||||
|
||||
|
||||
def _default_template_ctx_processor():
|
||||
|
|
@ -79,7 +80,7 @@ class DispatchingJinjaLoader(BaseLoader):
|
|||
except (ValueError, KeyError):
|
||||
pass
|
||||
|
||||
for blueprint in self.app.blueprints.itervalues():
|
||||
for blueprint in six.itervalues(self.app.blueprints):
|
||||
if blueprint_is_module(blueprint):
|
||||
continue
|
||||
loader = blueprint.jinja_loader
|
||||
|
|
@ -92,7 +93,7 @@ class DispatchingJinjaLoader(BaseLoader):
|
|||
if loader is not None:
|
||||
result.update(loader.list_templates())
|
||||
|
||||
for name, blueprint in self.app.blueprints.iteritems():
|
||||
for name, blueprint in six.iteritems(self.app.blueprints):
|
||||
loader = blueprint.jinja_loader
|
||||
if loader is not None:
|
||||
for template in loader.list_templates():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue