churchyard / rpms / python3

Forked from rpms/python3 2 years ago
Clone
285f55
From b9a703e3d37e325defe5baec111e1fbf5d42bede Mon Sep 17 00:00:00 2001
285f55
From: Bohuslav Kabrda <bkabrda@redhat.com>
285f55
Date: Wed, 10 Apr 2013 14:30:09 +0200
285f55
Subject: [PATCH 4/9] 00178: Don't duplicate various FLAGS in sysconfig values
285f55
285f55
http://bugs.python.org/issue17679
285f55
285f55
Does not affect python2 AFAICS (different sysconfig values initialization)
285f55
---
285f55
 Lib/distutils/sysconfig.py | 5 ++++-
285f55
 Lib/sysconfig.py           | 5 ++++-
285f55
 2 files changed, 8 insertions(+), 2 deletions(-)
285f55
285f55
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
285f55
index 9a4892a737..ad4cef088b 100644
285f55
--- a/Lib/distutils/sysconfig.py
285f55
+++ b/Lib/distutils/sysconfig.py
285f55
@@ -373,7 +373,10 @@ def parse_makefile(fn, g=None):
58f477
                     done[n] = item = ""
58f477
                 if found:
58f477
                     after = value[m.end():]
58f477
-                    value = value[:m.start()] + item + after
58f477
+                    value = value[:m.start()]
58f477
+                    if item.strip() not in value:
58f477
+                        value += item
58f477
+                    value += after
58f477
                     if "$" in after:
58f477
                         notdone[name] = value
58f477
                     else:
285f55
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
285f55
index cf64d79c4d..fd972d658c 100644
285f55
--- a/Lib/sysconfig.py
285f55
+++ b/Lib/sysconfig.py
285f55
@@ -295,7 +295,10 @@ def _parse_makefile(filename, vars=None):
58f477
 
58f477
                 if found:
58f477
                     after = value[m.end():]
58f477
-                    value = value[:m.start()] + item + after
58f477
+                    value = value[:m.start()]
58f477
+                    if item.strip() not in value:
58f477
+                        value += item
58f477
+                    value += after
58f477
                     if "$" in after:
58f477
                         notdone[name] = value
58f477
                     else:
285f55
-- 
285f55
2.21.0
285f55