(obj)
| 72 | |
| 73 | # 替换环境变量 |
| 74 | def replace_env_vars(obj): |
| 75 | if isinstance(obj, dict): |
| 76 | return {k: replace_env_vars(v) for k, v in obj.items()} |
| 77 | if isinstance(obj, str) and obj.startswith("${") and obj.endswith("}"): |
| 78 | return os.getenv(obj[2:-1], obj) |
| 79 | return obj |
| 80 | |
| 81 | return replace_env_vars(config) |
| 82 |
nothing calls this directly
no outgoing calls
no test coverage detected