Mercurial > p > roundup > code
comparison setup.py @ 7607:bb443db61d1c
fix: issue2551290? windows install works
It looks like windows installs have been broken since at least 2.1.0.
Installing on windows triggered an infinite loop.
Fix that in two different ways:
1 linux uses lib, windows uses Lib. Use case insenstive match.
2 linux uses / as the root windows uses C:\ (or other drive letter).
keep running the loop until the root/head path doesn't change.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Thu, 17 Aug 2023 12:58:37 -0400 |
| parents | ed2bc951277b |
| children | a426b5523aba |
comparison
equal
deleted
inserted
replaced
| 7606:7301b776a94a | 7607:bb443db61d1c |
|---|---|
| 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. Must start with / else infinite loop. | 90 # start with the platform library |
| 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 not in ['lib', 'lib64' ] and head != '/': | 94 old_head = None |
| 95 while tail.lower() not in ['lib', 'lib64' ] and head != old_head: | |
| 96 old_head = head | |
| 95 head, tail = os.path.split(head) | 97 head, tail = os.path.split(head) |
| 96 if head == '/': | 98 if head == old_head: |
| 97 head = sys.prefix | 99 head = sys.prefix |
| 98 return head | 100 return head |
| 99 | 101 |
| 100 | 102 |
| 101 def main(): | 103 def main(): |
