[pypy-svn] r57450 - pypy/branch/2.5-features/pypy/interpreter/pyparser

bgola at codespeak.net bgola at codespeak.net
Mon Aug 18 22:48:48 CEST 2008


Author: bgola
Date: Mon Aug 18 22:48:47 2008
New Revision: 57450

Modified:
   pypy/branch/2.5-features/pypy/interpreter/pyparser/astbuilder.py
Log:
fixes for translating pypy-c (asserts)

Modified: pypy/branch/2.5-features/pypy/interpreter/pyparser/astbuilder.py
==============================================================================
--- pypy/branch/2.5-features/pypy/interpreter/pyparser/astbuilder.py	(original)
+++ pypy/branch/2.5-features/pypy/interpreter/pyparser/astbuilder.py	Mon Aug 18 22:48:47 2008
@@ -842,10 +842,18 @@
     """
     atoms = get_atoms(builder, nb)
     index = 1 # skip from
-    while atoms[index].name == builder.parser.tokens['DOT']:
+    
+    atom = atoms[index]
+    assert isinstance(atom,  TokenObject)
+    while atom.name == builder.parser.tokens['DOT']:
         index += 1
+        atom = atoms[index]
+        assert isinstance(atom, TokenObject)
+        
     level = index - 1
-    if atoms[index].value == 'import': 
+    atom = atoms[index]
+    assert isinstance(atom, TokenObject)
+    if atom.value == 'import': 
         # from . import x
         from_name =  ""
         incr = 0



More information about the Pypy-commit mailing list