Skip to content

Commit 5fce7b9

Browse files
committed
Updated with changes suggested by the reviewer
1 parent 1765ce0 commit 5fce7b9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

byterun/pyvm2.py

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

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

615+
def byte_BUILD_LIST_UNPACK(self, count):
616+
elts = self.popn(count)
617+
self.push([e for l in elts for e in l])
618+
615619
def byte_BUILD_LIST(self, count):
616620
elts = self.popn(count)
617621
self.push(elts)
@@ -632,14 +636,14 @@ def byte_BUILD_CONST_KEY_MAP(self, count):
632636

633637
def byte_BUILD_MAP(self, count):
634638
# Pushes a new dictionary on to stack.
635-
if not(six.PY3 and sys.version_info.minor >= 5):
639+
if sys.version_info[:2] < (3, 5):
636640
self.push({})
637641
return
638642
# Pop 2*count items so that
639643
# dictionary holds count entries: {..., TOS3: TOS2, TOS1:TOS}
640644
# updated in version 3.5
641645
kvs = {}
642-
for i in range(0, count):
646+
for i in range(count):
643647
key, val = self.popn(2)
644648
kvs[key] = val
645649
self.push(kvs)

0 commit comments

Comments
 (0)