Skip to content

Commit

Permalink
pythongh-104146: Remove unused 'second_pass_replacements' from clinic.py
Browse files Browse the repository at this point in the history
The code that manipulated 'second_pass_replacements' was removed in 2015
with commit 0759f84 (pythongh-67688, bpo-23500).
  • Loading branch information
erlend-aasland committed May 3, 2023
1 parent b9ddf21 commit 9768f7f
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2112,8 +2112,6 @@ def parse(self, input):
traceback.format_exc().rstrip())
printer.print_block(block)

second_pass_replacements = {}

# these are destinations not buffers
for name, destination in self.destinations.items():
if destination.type == 'suppress':
Expand Down Expand Up @@ -2155,23 +2153,8 @@ def parse(self, input):
printer_2.print_block(block, core_includes=True)
write_file(destination.filename, printer_2.f.getvalue())
continue
text = printer.f.getvalue()

if second_pass_replacements:
printer_2 = BlockPrinter(self.language)
parser_2 = BlockParser(text, self.language)
changed = False
for block in parser_2:
if block.dsl_name:
for id, replacement in second_pass_replacements.items():
if id in block.output:
changed = True
block.output = block.output.replace(id, replacement)
printer_2.print_block(block)
if changed:
text = printer_2.f.getvalue()

return text

return printer.f.getvalue()


def _module_and_class(self, fields):
Expand Down

0 comments on commit 9768f7f

Please sign in to comment.