Commit 299b571
committed
Fix shared mutable default in BaseBuilder.get_config
Previously, get_configused a mutable default argument for `properties` (i.e. `properties: dict[str, str] = {}`), which caused all instances without an explicit `properties` argument to share the same dictionary. This led to unexpected behavior when one instance modified the dictionary, as changes were reflected across all others and some builders got a wrong value for `jobs`.
This commit replaces the default value with `None` and initializes a new dictionary inside the constructor when no value is provided. This ensures each instance has its own independent `properties` dictionary, preventing unintended side effects.1 parent c3c0602 commit 299b571
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| |||
0 commit comments