From: Andrew M. Kuchling Date: Tue, 16 Jan 2001 16:16:03 +0000 (+0000) Subject: Modified version of a patch from Jeremy Kloth, to make .get_outputs() X-Git-Tag: v2.1a1~226 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9710297e365185e7cdb1a1075a6a1b3d378bd4fc;p=python 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. --- diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py index 806da01afa..40e00705d3 100644 --- a/Lib/distutils/command/install.py +++ b/Lib/distutils/command/install.py @@ -530,7 +530,11 @@ class install (Command): outputs = [] for cmd_name in self.get_sub_commands(): cmd = self.get_finalized_command(cmd_name) - outputs.extend(cmd.get_outputs()) + # Add the contents of cmd.get_outputs(), ensuring + # that outputs doesn't contain duplicate entries + for filename in cmd.get_outputs(): + if filename not in outputs: + outputs.append(filename) return outputs