Author: Raffael Tfirst <raffael.tfi...@gmail.com>
Branch: py3.5-async
Changeset: r85629:062ebc10a032
Date: 2016-07-09 17:10 +0200
http://bitbucket.org/pypy/pypy/changeset/062ebc10a032/

Log:    Add missing async opcodes in python lib

diff --git a/lib-python/3/opcode.py b/lib-python/3/opcode.py
--- a/lib-python/3/opcode.py
+++ b/lib-python/3/opcode.py
@@ -85,7 +85,10 @@
 def_op('INPLACE_FLOOR_DIVIDE', 28)
 def_op('INPLACE_TRUE_DIVIDE', 29)
 
-def_op('STORE_MAP', 54)
+def_op('GET_AITER', 50)
+def_op('GET_ANEXT', 51)
+def_op('BEFORE_ASYNC_WITH', 52)
+
 def_op('INPLACE_ADD', 55)
 def_op('INPLACE_SUBTRACT', 56)
 def_op('INPLACE_MULTIPLY', 57)
@@ -100,11 +103,12 @@
 def_op('BINARY_OR', 66)
 def_op('INPLACE_POWER', 67)
 def_op('GET_ITER', 68)
-def_op('STORE_LOCALS', 69)
+def_op('GET_YIELD_FROM_ITER', 69)
 
 def_op('PRINT_EXPR', 70)
 def_op('LOAD_BUILD_CLASS', 71)
 def_op('YIELD_FROM', 72)
+def_op('GET_AWAITABLE', 73)
 
 def_op('INPLACE_LSHIFT', 75)
 def_op('INPLACE_RSHIFT', 76)
@@ -196,6 +200,11 @@
 def_op('SET_ADD', 146)
 def_op('MAP_ADD', 147)
 
+def_op('LOAD_CLASSDEREF', 148)
+hasfree.append(148)
+
+jrel_op('SETUP_ASYNC_WITH', 154)
+
 def_op('EXTENDED_ARG', 144)
 EXTENDED_ARG = 144
 
diff --git a/pypy/interpreter/astcompiler/test/test_astbuilder.py 
b/pypy/interpreter/astcompiler/test/test_astbuilder.py
--- a/pypy/interpreter/astcompiler/test/test_astbuilder.py
+++ b/pypy/interpreter/astcompiler/test/test_astbuilder.py
@@ -1340,8 +1340,8 @@
         # imatmul is tested earlier search for @=
     
     def test_asyncFunctionDef(self):
-        mod = self.get_ast("async def f():\n await something()")
-        assert isinstance(mod, ast.Module)
+        asyncdef = self.get_ast("async def f():\n await something()")
+        assert isinstance(asyncdef, ast.AsyncFunctionDef)
         body = mod.body
         assert len(body) == 1
         expr = body[0].value
diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -1402,7 +1402,21 @@
             self.popvalue()
             itemcount -= 1
         self.pushvalue(w_dict)
-        
+    
+    def GET_AWAITABLE(self):
+        pass
+    
+    def SETUP_ASYNC_WITH(self):
+        pass
+    
+    def BEFORE_ASYNC_WITH(self):
+        pass
+    
+    def GET_AITER(self):
+        pass
+    
+    def GET_ANEXT(self):
+        pass
         
 ### ____________________________________________________________ ###
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to