PEP 3114: rename .next() to .__next__() and add next() builtin.
diff --git a/Lib/inspect.py b/Lib/inspect.py
index d4cfc07..0be0419 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -603,7 +603,7 @@
     """Extract the block of code at the top of the given list of lines."""
     blockfinder = BlockFinder()
     try:
-        tokenize.tokenize(iter(lines).next, blockfinder.tokeneater)
+        tokenize.tokenize(iter(lines).__next__, blockfinder.tokeneater)
     except (EndOfBlock, IndentationError):
         pass
     return lines[:blockfinder.last]