changeset 6572:2e568d6f72a4

issue2551169 - setup.py enters endless loop on gentoo linux python2 installation. Recognized lib64 as a possible valid path. Also exit when / is found.
author John Rouillard <rouilj@ieee.org>
date Thu, 23 Dec 2021 16:00:21 -0500
parents cd408eb748dd
children 4b627102b344
files CHANGES.txt setup.py
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Thu Dec 23 02:20:53 2021 -0500
+++ b/CHANGES.txt	Thu Dec 23 16:00:21 2021 -0500
@@ -63,6 +63,8 @@
   seconds. This seems to help reduce stalled connections when a
   number of connections are made at the same time. Log remaining
   retries once 5 of them have been used. (John Rouillard)
+- issue2551169 - setup.py enters endless loop on gentoo linux python2
+  installation. Fixed.
 
 Features:
 
--- a/setup.py	Thu Dec 23 02:20:53 2021 -0500
+++ b/setup.py	Thu Dec 23 16:00:21 2021 -0500
@@ -87,13 +87,13 @@
     if prefix:
         return prefix
     else:
-        # get the platform lib path.
+        # get the platform lib path. Must start with / else infinite loop.
         plp = get_path('platlib')
         # nuke suffix that matches lib/* and return prefix
         head, tail = os.path.split(plp)
-        while tail != 'lib' and head != '':
+        while tail not in ['lib', 'lib64' ] and head != '/':
             head, tail = os.path.split(head)
-        if not head:
+        if head == '/':
             head = sys.prefix
         return head
 

Roundup Issue Tracker: http://roundup-tracker.org/