Author: Raffael Tfirst <[email protected]>
Branch: py3.5
Changeset: r85248:e451b4b82bb1
Date: 2016-06-20 18:21 +0200
http://bitbucket.org/pypy/pypy/changeset/e451b4b82bb1/
Log: Fix bug if keyword.arg is None on keyword argument unpack, insert
new pyopcodes in dispatch method
diff --git a/pypy/interpreter/astcompiler/assemble.py
b/pypy/interpreter/astcompiler/assemble.py
--- a/pypy/interpreter/astcompiler/assemble.py
+++ b/pypy/interpreter/astcompiler/assemble.py
@@ -397,7 +397,6 @@
for block in blocks:
depth = self._do_stack_depth_walk(block)
if block.auto_inserted_return and depth != 0:
- #depth is 1, import pdb;pdb.pm()
os.write(2, "StackDepthComputationError in %s at %s:%s\n" % (
self.compile_info.filename, self.name, self.first_lineno))
raise StackDepthComputationError # fatal error
diff --git a/pypy/interpreter/astcompiler/codegen.py
b/pypy/interpreter/astcompiler/codegen.py
--- a/pypy/interpreter/astcompiler/codegen.py
+++ b/pypy/interpreter/astcompiler/codegen.py
@@ -1128,7 +1128,8 @@
self.name_op(name.id, name.ctx)
def visit_keyword(self, keyword):
- self.load_const(self.space.wrap(keyword.arg.decode('utf-8')))
+ if keyword.arg is not None:
+ self.load_const(self.space.wrap(keyword.arg.decode('utf-8')))
keyword.value.walkabout(self)
def _make_call(self, n, # args already pushed
diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -258,6 +258,16 @@
self.BUILD_MAP(oparg, next_instr)
elif opcode == opcodedesc.BUILD_SET.index:
self.BUILD_SET(oparg, next_instr)
+ elif opcode == opcodedesc.BUILD_SET_UNPACK.index:
+ self.BUILD_SET_UNPACK(oparg, next_instr)
+ elif opcode == opcodedesc.BUILD_TUPLE_UNPACK.index:
+ self.BUILD_TUPLE_UNPACK(oparg, next_instr)
+ elif opcode == opcodedesc.BUILD_LIST_UNPACK.index:
+ self.BUILD_LIST_UNPACK(oparg, next_instr)
+ elif opcode == opcodedesc.BUILD_MAP_UNPACK.index:
+ self.BUILD_MAP_UNPACK(oparg, next_instr)
+ elif opcode == opcodedesc.BUILD_MAP_UNPACK_WITH_CALL.index:
+ self.BUILD_MAP_UNPACK_WITH_CALL(oparg, next_instr)
elif opcode == opcodedesc.BUILD_SLICE.index:
self.BUILD_SLICE(oparg, next_instr)
elif opcode == opcodedesc.BUILD_TUPLE.index:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit