thrnciar / rpms / python3.5

Forked from rpms/python3.5 3 years ago
Clone
Blob Blame History Raw
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Bohuslav Kabrda <bkabrda@redhat.com>
Date: Wed, 10 Apr 2013 14:30:09 +0200
Subject: [PATCH] 00178: Don't duplicate various FLAGS in sysconfig values

http://bugs.python.org/issue17679
Does not affect python2 AFAICS (different sysconfig values initialization)
---
 Lib/distutils/sysconfig.py | 5 ++++-
 Lib/sysconfig.py           | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 9bb3c2f1de..68f44c27f6 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -354,7 +354,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 31bc2edfb0..b021cce475 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: