Merge pull request #451 from andrem-eberle/master

Tentative fix for #439
This commit is contained in:
R. Bernstein
2023-04-17 19:32:33 -04:00
committed by GitHub
3 changed files with 11 additions and 4 deletions

View File

@@ -725,3 +725,10 @@ values = {
}
assert sorted(values.values())[1:] == list(range(2, 34))
# Check that we can distinguish names from strings in literal collections, e.g. lists.
# The list has to have more than 4 items to get accumulated in a collection
a = ["y", 'Exception', "x", Exception, "z"]
assert a[1] == "Exception"
assert a[3] == Exception

View File

@@ -171,11 +171,11 @@ class Scanner(object):
has_extended_arg=False,
)
)
if tokens[j] == "LOAD_CONST":
opname = "ADD_VALUE"
else:
opname = "ADD_VALUE_VAR"
for j in range(collection_start, i):
if tokens[j] == "LOAD_CONST":
opname = "ADD_VALUE"
else:
opname = "ADD_VALUE_VAR"
new_tokens.append(
Token(
opname=opname,