Mercurial > p > roundup > code
comparison setup.py @ 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 | f961dbbc3573 |
| children | 4b627102b344 |
comparison
equal
deleted
inserted
replaced
| 6571:cd408eb748dd | 6572:2e568d6f72a4 |
|---|---|
| 85 # strip '--prefix=' | 85 # strip '--prefix=' |
| 86 prefix=a[9:] | 86 prefix=a[9:] |
| 87 if prefix: | 87 if prefix: |
| 88 return prefix | 88 return prefix |
| 89 else: | 89 else: |
| 90 # get the platform lib path. | 90 # get the platform lib path. Must start with / else infinite loop. |
| 91 plp = get_path('platlib') | 91 plp = get_path('platlib') |
| 92 # nuke suffix that matches lib/* and return prefix | 92 # nuke suffix that matches lib/* and return prefix |
| 93 head, tail = os.path.split(plp) | 93 head, tail = os.path.split(plp) |
| 94 while tail != 'lib' and head != '': | 94 while tail not in ['lib', 'lib64' ] and head != '/': |
| 95 head, tail = os.path.split(head) | 95 head, tail = os.path.split(head) |
| 96 if not head: | 96 if head == '/': |
| 97 head = sys.prefix | 97 head = sys.prefix |
| 98 return head | 98 return head |
| 99 | 99 |
| 100 | 100 |
| 101 def main(): | 101 def main(): |
