1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# HG changeset patch
# User Mike Hommey <mh+mozilla@glandium.org>
# Date 1755580114 0
# Node ID dbf9702ed87ea5c88c2a1ee615998532ac8f10cc
# Parent 256a75a8756dc70d9c849cb2d6af260837496ebc
Bug 1983713 - Use non-deprecated ast value. r=firefox-build-system-reviewers,nalexander,ahochheiden
ast.Str was deprecated in python 3.12 and removed in 3.14. It inherited
from ast.Constant, `Str.s` was equivalent to `Constant.value`, so we can
use the latter on both old and newer python versions.
Differential Revision: https://phabricator.services.mozilla.com/D261511
diff --git a/python/mach/mach/command_util.py b/python/mach/mach/command_util.py
--- a/python/mach/mach/command_util.py
+++ b/python/mach/mach/command_util.py
@@ -292,17 +292,17 @@ class DecoratorVisitor(ast.NodeVisitor):
]
relevant_kwargs = ["command", "subcommand", "virtualenv_name"]
for decorator in decorators:
kwarg_dict = {}
for name, arg in zip(["command", "subcommand"], decorator.args):
- kwarg_dict[name] = arg.s
+ kwarg_dict[name] = arg.value
for keyword in decorator.keywords:
if keyword.arg not in relevant_kwargs:
# We only care about these 3 kwargs, so we can safely skip the rest
continue
kwarg_dict[keyword.arg] = getattr(keyword.value, "s", "")
|