_format_env() prefixes all given environment variables with the given prefix so it can be passed directly to cmd.run().
(prefix: str, env: Mapping[str, object])
| 24 | |
| 25 | |
| 26 | def _format_env(prefix: str, env: Mapping[str, object]) -> dict[str, str]: |
| 27 | """_format_env() prefixes all given environment variables with the given |
| 28 | prefix so it can be passed directly to cmd.run().""" |
| 29 | penv = dict(os.environ) |
| 30 | for name, value in env.items(): |
| 31 | name = prefix + name.upper() |
| 32 | value = str(value) if value is not None else "" |
| 33 | penv[name] = value |
| 34 | |
| 35 | return penv |
no outgoing calls
no test coverage detected
searching dependent graphs…