[pypy-svn] pypy compile-from-stream: Use a slightly more robust code structure

amauryfa commits-noreply at bitbucket.org
Tue Mar 22 19:55:58 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: compile-from-stream
Changeset: r42849:f3c8ea0715ef
Date: 2011-03-22 19:53 +0100
http://bitbucket.org/pypy/pypy/changeset/f3c8ea0715ef/

Log:	Use a slightly more robust code structure

diff --git a/pypy/interpreter/pyparser/future.py b/pypy/interpreter/pyparser/future.py
--- a/pypy/interpreter/pyparser/future.py
+++ b/pypy/interpreter/pyparser/future.py
@@ -30,13 +30,12 @@
                 except KeyError:
                     pass
                 pos = elem.lineno, elem.col_offset
+            continue
         elif isinstance(elem, ast.Expr):
-            if found_docstring:
-                break
-            if isinstance(elem.value, ast.Str):
+            if not found_docstring and isinstance(elem.value, ast.Str):
                 found_docstring = True
-        else:
-            break
+                continue
+        break
     return flags, pos
 
 class FutureFlags(object):


More information about the Pypy-commit mailing list