diff options
author | Erlend E. Aasland <erlend.aasland@protonmail.com> | 2023-05-20 10:52:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-20 10:52:32 (GMT) |
commit | ae147d01a005e0a65510a605762d1ff79f3affb9 (patch) | |
tree | dfa5d4bd6094adeee3a86ddc9cab6dc3702fc5df | |
parent | 02b60035ceb735c3f7dd5bb7dc6a1508748a7a8d (diff) | |
download | cpython-ae147d01a005e0a65510a605762d1ff79f3affb9.zip cpython-ae147d01a005e0a65510a605762d1ff79f3affb9.tar.gz cpython-ae147d01a005e0a65510a605762d1ff79f3affb9.tar.bz2 |
gh-104146: Purge dead code from Argument Clinic (#104680)
The following local variables were assigned but never used:
- line 551: result
- line 1341: groups
- line 1431: default_return_converter
- line 1529: ignore_self
- line 1809: input_checksum
- line 4224: new'
---
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
-rwxr-xr-x | Tools/clinic/clinic.py | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 521191e..792e8e4 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -548,8 +548,6 @@ def permute_optional_groups(left, required, right): If required is empty, left must also be empty. """ required = tuple(required) - result = [] - if not required: if left: raise ValueError("required is empty but left is not") @@ -1338,7 +1336,6 @@ class CLanguage(Language): if isinstance(parameters[0].converter, self_converter): del parameters[0] - groups = [] group = None left = [] right = [] @@ -1428,8 +1425,6 @@ class CLanguage(Language): first_optional = len(selfless) positional = selfless and selfless[-1].is_positional_only() new_or_init = f.kind in (METHOD_NEW, METHOD_INIT) - default_return_converter = (not f.return_converter or - f.return_converter.type == 'PyObject *') has_option_groups = False # offset i by -1 because first_optional needs to ignore self @@ -1526,7 +1521,6 @@ class CLanguage(Language): template_dict['return_value'] = data.return_value # used by unpack tuple code generator - ignore_self = -1 if isinstance(converters[0], self_converter) else 0 unpack_min = first_optional unpack_max = len(selfless) template_dict['unpack_min'] = str(unpack_min) @@ -1803,10 +1797,8 @@ class BlockParser: if self.verify: if 'input' in d: checksum = d['output'] - input_checksum = d['input'] else: checksum = d['checksum'] - input_checksum = None computed = compute_checksum(output, len(checksum)) if checksum != computed: @@ -4243,8 +4235,7 @@ class DSLParser: fail("Insufficient Clinic version!\n Version: " + version + "\n Required: " + required) def directive_module(self, name): - fields = name.split('.') - new = fields.pop() + fields = name.split('.')[:-1] module, cls = self.clinic._module_and_class(fields) if cls: fail("Can't nest a module inside a class!") |