Bobby Bruce has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53843 )

Change subject: stdlib: Fix CustomResource metadata
......................................................................

stdlib: Fix CustomResource metadata

CustomResource's base class, AbstractResource, must be constructed with
a dictionary for the 'metadata' field. However, if the user did not
specify any metadata for the CustomResource, None is passed. This is
not permitted and can cause error. This patch ensures the metadata is
set to an empty dictionary by default

Change-Id: I358725ee6982dc9c6410eac3ad8194fa676dd326
---
M src/python/gem5/resources/resource.py
1 file changed, 17 insertions(+), 1 deletion(-)



diff --git a/src/python/gem5/resources/resource.py b/src/python/gem5/resources/resource.py
index 0b9b128..212ec5a 100644
--- a/src/python/gem5/resources/resource.py
+++ b/src/python/gem5/resources/resource.py
@@ -73,11 +73,12 @@
     repository.
     """

-    def __init__(self, local_path: str, metadata: Optional[Dict] = None):
+    def __init__(self, local_path: str, metadata: Dict = {}):
         """
         :param local_path: The path of the resource on the host system.
         :param metadata: Add metadata for the custom resource.
         """
+
         super().__init__(local_path=local_path, metadata=metadata)



--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53843
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I358725ee6982dc9c6410eac3ad8194fa676dd326
Gerrit-Change-Number: 53843
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby Bruce <bbr...@ucdavis.edu>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to