mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
gh-104146: Remove unused 'second_pass_replacements' from clinic.py (#104147)
The code that manipulated 'second_pass_replacements' was removed in 2015
with commit 0759f84
(gh-67688, bpo-23500).
This commit is contained in:
parent
e95dd40aff
commit
9885677b04
1 changed files with 1 additions and 18 deletions
|
@ -2112,8 +2112,6 @@ impl_definition block
|
||||||
traceback.format_exc().rstrip())
|
traceback.format_exc().rstrip())
|
||||||
printer.print_block(block)
|
printer.print_block(block)
|
||||||
|
|
||||||
second_pass_replacements = {}
|
|
||||||
|
|
||||||
# these are destinations not buffers
|
# these are destinations not buffers
|
||||||
for name, destination in self.destinations.items():
|
for name, destination in self.destinations.items():
|
||||||
if destination.type == 'suppress':
|
if destination.type == 'suppress':
|
||||||
|
@ -2155,23 +2153,8 @@ impl_definition block
|
||||||
printer_2.print_block(block, core_includes=True)
|
printer_2.print_block(block, core_includes=True)
|
||||||
write_file(destination.filename, printer_2.f.getvalue())
|
write_file(destination.filename, printer_2.f.getvalue())
|
||||||
continue
|
continue
|
||||||
text = printer.f.getvalue()
|
|
||||||
|
|
||||||
if second_pass_replacements:
|
return printer.f.getvalue()
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
def _module_and_class(self, fields):
|
def _module_and_class(self, fields):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue