Skip to content

Commit 59f9eb4

Browse files
committed
Merge branch 'py36' into modules
2 parents 16da483 + 5fce7b9 commit 59f9eb4

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

byterun/pyvm2.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,8 @@ def byte_BUILD_TUPLE_UNPACK_WITH_CALL(self, count):
599599
# This is similar to BUILD_TUPLE_UNPACK, but is used for f(*x, *y, *z)
600600
# call syntax. The stack item at position count + 1 should be the
601601
# corresponding callable f.
602-
elts = self.popn(count)
603-
self.push(tuple(e for l in elts for e in l))
602+
self.byte_BUILD_TUPLE_UNPACK(count)
603+
604604

605605
def byte_BUILD_TUPLE_UNPACK(self, count):
606606
# Pops count iterables from the stack, joins them in a single tuple,
@@ -613,6 +613,10 @@ def byte_BUILD_TUPLE(self, count):
613613
elts = self.popn(count)
614614
self.push(tuple(elts))
615615

616+
def byte_BUILD_LIST_UNPACK(self, count):
617+
elts = self.popn(count)
618+
self.push([e for l in elts for e in l])
619+
616620
def byte_BUILD_LIST(self, count):
617621
elts = self.popn(count)
618622
self.push(elts)
@@ -633,14 +637,14 @@ def byte_BUILD_CONST_KEY_MAP(self, count):
633637

634638
def byte_BUILD_MAP(self, count):
635639
# Pushes a new dictionary on to stack.
636-
if not(six.PY3 and sys.version_info.minor >= 5):
640+
if sys.version_info[:2] < (3, 5):
637641
self.push({})
638642
return
639643
# Pop 2*count items so that
640644
# dictionary holds count entries: {..., TOS3: TOS2, TOS1:TOS}
641645
# updated in version 3.5
642646
kvs = {}
643-
for i in range(0, count):
647+
for i in range(count):
644648
key, val = self.popn(2)
645649
kvs[key] = val
646650
self.push(kvs)
@@ -1063,7 +1067,7 @@ def byte_CALL_FUNCTION_VAR(self, arg):
10631067
def byte_CALL_FUNCTION_KW(self, argc):
10641068
if not(six.PY3 and sys.version_info.minor >= 6):
10651069
kwargs = self.pop()
1066-
return self.call_function(arg, [], kwargs)
1070+
return self.call_function(argc, [], kwargs)
10671071
# changed in 3.6: keyword arguments are packed in a tuple instead
10681072
# of a dict. argc indicates total number of args.
10691073
kwargnames = self.pop()

0 commit comments

Comments
 (0)