mirror of
https://github.com/katanemo/plano.git
synced 2026-05-10 16:22:42 +02:00
fix(cli): drop function-local import yaml shadowing module global in up (#916)
`up()` had a redundant inline `import yaml` (line 444) even though `yaml` is already imported at the module top (line 9). Python's compile-time scope analysis turned `yaml` into a function-local for the entire body, which was harmless until #890 added `yaml.safe_dump(...)` earlier in the same function (in the synthesized-default-config branch). After #890, running `planoai up` in any directory without a config file crashes with: UnboundLocalError: cannot access local variable 'yaml' where it is not associated with a value File "cli/planoai/main.py", line 388, in up yaml.safe_dump(cfg_dict, fh, sort_keys=False) Removing the redundant inline import lets the module-level `yaml` resolve normally on both code paths.
This commit is contained in:
parent
473ec70b5c
commit
92f82a9c68
1 changed files with 0 additions and 2 deletions
|
|
@ -441,8 +441,6 @@ def up(
|
|||
env = os.environ.copy()
|
||||
env.pop("PATH", None)
|
||||
|
||||
import yaml
|
||||
|
||||
with open(plano_config_file, "r") as f:
|
||||
plano_config = yaml.safe_load(f)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue