(self, source)
| 57 | self._env = self._parse_source_env(source) |
| 58 | |
| 59 | def _parse_source_env(self, source): |
| 60 | env_match = ENV_PATTERN.search(source) |
| 61 | # https://crbug.com/v8/8845 |
| 62 | if 'LC_ALL' in os.environ: |
| 63 | del os.environ['LC_ALL'] |
| 64 | env = {} |
| 65 | if env_match: |
| 66 | for env_pair in env_match.group(1).strip().split(): |
| 67 | var, value = env_pair.split('=') |
| 68 | env[var] = value |
| 69 | return env |
| 70 | |
| 71 | def _get_cmd_env(self): |
| 72 | return self._env |