Concatenate two environment paths avoiding repeats. Here `old` is the environment string before the base class initialize function is called and `new` is the string after the call. The new string will be a fixed string if it is not obtained from the current environment, or the same
(old, new)
| 5 | |
| 6 | |
| 7 | def _merge(old, new): |
| 8 | """Concatenate two environment paths avoiding repeats. |
| 9 | |
| 10 | Here `old` is the environment string before the base class initialize |
| 11 | function is called and `new` is the string after the call. The new string |
| 12 | will be a fixed string if it is not obtained from the current environment, |
| 13 | or the same as the old string if obtained from the same environment. The aim |
| 14 | here is not to append the new string if it is already contained in the old |
| 15 | string so as to limit the growth of the environment string. |
| 16 | |
| 17 | Parameters |
| 18 | ---------- |
| 19 | old : string |
| 20 | Previous environment string. |
| 21 | new : string |
| 22 | New environment string. |
| 23 | |
| 24 | Returns |
| 25 | ------- |
| 26 | ret : string |
| 27 | Updated environment string. |
| 28 | |
| 29 | """ |
| 30 | if new in old: |
| 31 | return old |
| 32 | if not old: |
| 33 | return new |
| 34 | |
| 35 | # Neither new nor old is empty. Give old priority. |
| 36 | return ';'.join([old, new]) |
| 37 | |
| 38 | |
| 39 | class MSVCCompiler(_MSVCCompiler): |