Skip to content
Myr

python-modernize automated changes: fix_next

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Thomas Waldmann · committed by Thomas Waldmann · parent 0f8c47c · Browse files · 3 files+5 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+5 added−3 removed

  • other:+5 added−3 removed

3 files+5 added−3 removed

modified:flask/testsuite/helpers.py+2 added-1 removed
16 unmodified lines
17from logging import StreamHandler18from StringIO import StringIO19from flask.testsuite import FlaskTestCase, catch_warnings, catch_stderr20from werkzeug.http import parse_cache_control_header, parse_options_header21import six222324def has_encoding(name):25 try:
481 unmodified lines
507 return self508 def close(self):509 called.append(42)510 def next(self):510 return self._gen.next()511 return six.advance_iterator(self._gen)512 @app.route('/')513 def index():514 def generate():515 yield 'Hello '
19 unmodified lines
modified:flask/helpers.py+2 added-1 removed
24 unmodified lines
252627from werkzeug.datastructures import Headers28from werkzeug.exceptions import NotFound29import six3031# this was moved in 0.732try:33 from werkzeug.wsgi import wrap_file
94 unmodified lines
128 # the first dummy None is yielded at which point the context was already129 # pushed. This item is discarded. Then when the iteration continues the130 # real generator is executed.131 wrapped_g = generator()131 wrapped_g.next()132 six.advance_iterator(wrapped_g)133 return wrapped_g134135136def make_response(*args):
710 unmodified lines
modified:flask/sessions.py+1 added-1 removed
83 unmodified lines
84 def loads(self, value):85 def object_hook(obj):86 if len(obj) != 1:87 return obj88 the_key, the_value = obj.iteritems().next()88 the_key, the_value = six.advance_iterator(obj.iteritems())89 if the_key == ' t':90 return tuple(the_value)91 elif the_key == ' u':92 return uuid.UUID(the_value)
235 unmodified lines