|
| 1 | +diff --git a/python/mozbuild/mozbuild/frontend/reader.py b/python/mozbuild/mozbuild/frontend/reader.py |
| 2 | +index 9f6292cb909de..89bf9995c1768 100644 |
| 3 | +--- a/python/mozbuild/mozbuild/frontend/reader.py |
| 4 | ++++ b/python/mozbuild/mozbuild/frontend/reader.py |
| 5 | +@@ -470,7 +470,7 @@ def c(new_node): |
| 6 | + return c( |
| 7 | + ast.Subscript( |
| 8 | + value=c(ast.Name(id=self._global_name, ctx=ast.Load())), |
| 9 | +- slice=c(ast.Index(value=c(ast.Str(s=node.id)))), |
| 10 | ++ slice=c(ast.Index(value=c(ast.Constant(value=node.id)))), |
| 11 | + ctx=node.ctx, |
| 12 | + ) |
| 13 | + ) |
| 14 | +@@ -1039,8 +1039,8 @@ def assigned_variable(node): |
| 15 | + else: |
| 16 | + # Others |
| 17 | + assert isinstance(target.slice, ast.Index) |
| 18 | +- assert isinstance(target.slice.value, ast.Str) |
| 19 | +- key = target.slice.value.s |
| 20 | ++ assert isinstance(target.slice.value, ast.Constant) |
| 21 | ++ key = target.slice.value.value |
| 22 | + elif isinstance(target, ast.Attribute): |
| 23 | + assert isinstance(target.attr, str) |
| 24 | + key = target.attr |
| 25 | +@@ -1051,11 +1051,11 @@ def assigned_values(node): |
| 26 | + value = node.value |
| 27 | + if isinstance(value, ast.List): |
| 28 | + for v in value.elts: |
| 29 | +- assert isinstance(v, ast.Str) |
| 30 | +- yield v.s |
| 31 | ++ assert isinstance(v, ast.Constant) |
| 32 | ++ yield v.value |
| 33 | + else: |
| 34 | +- assert isinstance(value, ast.Str) |
| 35 | +- yield value.s |
| 36 | ++ assert isinstance(value, ast.Constant) |
| 37 | ++ yield value.value |
| 38 | + |
| 39 | + assignments = [] |
| 40 | + |
| 41 | +diff --git a/python/mozbuild/mozbuild/vendor/rewrite_mozbuild.py b/python/mozbuild/mozbuild/vendor/rewrite_mozbuild.py |
| 42 | +index cfcc0f18b9a9a..de06b58819b6a 100644 |
| 43 | +--- a/python/mozbuild/mozbuild/vendor/rewrite_mozbuild.py |
| 44 | ++++ b/python/mozbuild/mozbuild/vendor/rewrite_mozbuild.py |
| 45 | +@@ -327,15 +327,13 @@ def assignment_node_to_source_filename_list(code, node): |
| 46 | + """ |
| 47 | + if isinstance(node.value, ast.List) and "elts" in node.value._fields: |
| 48 | + for f in node.value.elts: |
| 49 | +- if not isinstance(f, ast.Constant) and not isinstance(f, ast.Str): |
| 50 | ++ if not isinstance(f, ast.Constant): |
| 51 | + log( |
| 52 | + "Found non-constant source file name in list: ", |
| 53 | + ast_get_source_segment(code, f), |
| 54 | + ) |
| 55 | + return [] |
| 56 | +- return [ |
| 57 | +- f.value if isinstance(f, ast.Constant) else f.s for f in node.value.elts |
| 58 | +- ] |
| 59 | ++ return [f.value for f in node.value.elts] |
| 60 | + elif isinstance(node.value, ast.ListComp): |
| 61 | + # SOURCES += [f for f in foo if blah] |
| 62 | + log("Could not find the files for " + ast_get_source_segment(code, node.value)) |
0 commit comments