Remove duplicate entries from sys.path along with making them absolute
()
| 132 | |
| 133 | |
| 134 | def removeduppaths(): |
| 135 | """ Remove duplicate entries from sys.path along with making them |
| 136 | absolute""" |
| 137 | # This ensures that the initial path provided by the interpreter contains |
| 138 | # only absolute pathnames, even if we're running from the build directory. |
| 139 | L = [] |
| 140 | known_paths = set() |
| 141 | for dir in sys.path: |
| 142 | # Filter out duplicate paths (on case-insensitive file systems also |
| 143 | # if they only differ in case); turn relative paths into absolute |
| 144 | # paths. |
| 145 | dir, dircase = makepath(dir) |
| 146 | if dircase not in known_paths: |
| 147 | L.append(dir) |
| 148 | known_paths.add(dircase) |
| 149 | sys.path[:] = L |
| 150 | return known_paths |
| 151 | |
| 152 | |
| 153 | def _init_pathinfo(): |