fix: enc outputs *id001 in class/environment

- the slice notation [:] creates a shallow copy of the list
- when dumping the data, it will not use the anchors and aliases because it
treats the values in enc_role and classes as separate lists
This commit is contained in:
Ben Vincent 2023-11-05 17:51:28 +11:00
parent ec3f431b45
commit 814b4e59b4

4
enc.py
View File

@ -34,11 +34,11 @@ def main():
# Add 'enc_role' parameter with classes data
if "classes" in data:
data["parameters"]["enc_role"] = data["classes"]
data["parameters"]["enc_role"] = data["classes"][:]
# Copy the environment to the parameters, if it exists
if data.get("environment"):
data["parameters"]["enc_env"] = data["environment"]
data["parameters"]["enc_env"] = data["environment"][:]
# If the environment is 'testing', remove it
if data.get("environment") == "testing":