Show More
@@ -718,10 +718,10 b' class IPCompleter(Completer):' | |||
|
718 | 718 | isId = re.compile(r'\w+$').match |
|
719 | 719 | while True: |
|
720 | 720 | try: |
|
721 |
ids.append( |
|
|
721 | ids.append(next(iterTokens)) | |
|
722 | 722 | if not isId(ids[-1]): |
|
723 | 723 | ids.pop(); break |
|
724 |
if not |
|
|
724 | if not next(iterTokens) == '.': | |
|
725 | 725 | break |
|
726 | 726 | except StopIteration: |
|
727 | 727 | break |
@@ -930,7 +930,7 b' class spawnb(object):' | |||
|
930 | 930 | |
|
931 | 931 | return self |
|
932 | 932 | |
|
933 | def next (self): # File-like object. | |
|
933 | def __next__ (self): # File-like object. | |
|
934 | 934 | |
|
935 | 935 | """This is to support iterators over a file-like object. |
|
936 | 936 | """ |
@@ -940,6 +940,9 b' class spawnb(object):' | |||
|
940 | 940 | raise StopIteration |
|
941 | 941 | return result |
|
942 | 942 | |
|
943 | if not PY3: | |
|
944 | next = __next__ # File-like object. | |
|
945 | ||
|
943 | 946 | def readlines (self, sizehint = -1): # File-like object. |
|
944 | 947 | |
|
945 | 948 | """This reads until EOF using readline() and returns a list containing |
@@ -174,7 +174,7 b' class PygmentsHighlighter(QtGui.QSyntaxHighlighter):' | |||
|
174 | 174 | def _get_format_from_document(self, token, document): |
|
175 | 175 | """ Returns a QTextCharFormat for token by |
|
176 | 176 | """ |
|
177 |
code, html = self._formatter._format_lines([(token, u'dummy')]) |
|
|
177 | code, html = next(self._formatter._format_lines([(token, u'dummy')])) | |
|
178 | 178 | self._document.setHtml(html) |
|
179 | 179 | return QtGui.QTextCursor(self._document).charFormat() |
|
180 | 180 |
@@ -51,7 +51,7 b' class ParametricTestCase(unittest.TestCase):' | |||
|
51 | 51 | # Test execution |
|
52 | 52 | ok = False |
|
53 | 53 | try: |
|
54 |
|
|
|
54 | next(testgen) | |
|
55 | 55 | ok = True |
|
56 | 56 | except StopIteration: |
|
57 | 57 | # We stop the loop |
@@ -179,7 +179,7 b' def arg_split(s, posix=False, strict=True):' | |||
|
179 | 179 | tokens = [] |
|
180 | 180 | while True: |
|
181 | 181 | try: |
|
182 |
tokens.append( |
|
|
182 | tokens.append(next(lex)) | |
|
183 | 183 | except StopIteration: |
|
184 | 184 | break |
|
185 | 185 | except ValueError: |
@@ -5,6 +5,7 b' from io import StringIO' | |||
|
5 | 5 | from session import extract_header, Message |
|
6 | 6 | |
|
7 | 7 | from IPython.utils import io, text, encoding |
|
8 | from IPython.utils import py3compat | |
|
8 | 9 | |
|
9 | 10 | #----------------------------------------------------------------------------- |
|
10 | 11 | # Globals |
@@ -54,9 +55,12 b' class OutStream(object):' | |||
|
54 | 55 | def isatty(self): |
|
55 | 56 | return False |
|
56 | 57 | |
|
57 | def next(self): | |
|
58 | def __next__(self): | |
|
58 | 59 | raise IOError('Read not supported on a write only stream.') |
|
59 | 60 | |
|
61 | if not py3compat.PY3: | |
|
62 | next = __next__ | |
|
63 | ||
|
60 | 64 | def read(self, size=-1): |
|
61 | 65 | raise IOError('Read not supported on a write only stream.') |
|
62 | 66 |
@@ -272,6 +272,7 b" if 'setuptools' in sys.modules:" | |||
|
272 | 272 | 'lib2to3.fixes.fix_except', |
|
273 | 273 | 'lib2to3.fixes.fix_apply', |
|
274 | 274 | 'lib2to3.fixes.fix_repr', |
|
275 | 'lib2to3.fixes.fix_next', | |
|
275 | 276 | ] |
|
276 | 277 | from setuptools.command.build_py import build_py |
|
277 | 278 | setup_args['cmdclass'] = {'build_py': record_commit_info('IPython', build_cmd=build_py)} |
General Comments 0
You need to be logged in to leave comments.
Login now