Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9710297

Browse files
committed
Modified version of a patch from Jeremy Kloth, to make .get_outputs()
produce a list of unique filenames: "While attempting to build an RPM using distutils on Python 2.0, rpm complained about duplicate files. The following patch fixed that problem.
1 parent c00df0b commit 9710297

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Lib/distutils/command/install.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,11 @@ def get_outputs (self):
530530
outputs = []
531531
for cmd_name in self.get_sub_commands():
532532
cmd = self.get_finalized_command(cmd_name)
533-
outputs.extend(cmd.get_outputs())
533+
# Add the contents of cmd.get_outputs(), ensuring
534+
# that outputs doesn't contain duplicate entries
535+
for filename in cmd.get_outputs():
536+
if filename not in outputs:
537+
outputs.append(filename)
534538

535539
return outputs
536540

0 commit comments

Comments
 (0)