commit f79998e970bc6484d0d99c37e5cad179d76e0190 Author: Philippe Makowski <pmakowski@espelida.com> Date: Sun Jul 3 17:49:47 2016 +0200 dont-duplicate-flags-in-sysconfig diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py index 6e58533..a4846eb 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -357,7 +357,10 @@ def parse_makefile(fn, g=None): done[n] = item = "" if found: after = value[m.end():] - value = value[:m.start()] + item + after + value = value[:m.start()] + if item.strip() not in value: + value += item + value += after if "$" in after: notdone[name] = value else: diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 31bc2ed..b021cce 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -294,7 +294,10 @@ def _parse_makefile(filename, vars=None): if found: after = value[m.end():] - value = value[:m.start()] + item + after + value = value[:m.start()] + if item.strip() not in value: + value += item + value += after if "$" in after: notdone[name] = value else: