Bobby Bruce has submitted this change. ( 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
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53843
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/python/gem5/resources/resource.py
1 file changed, 20 insertions(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/python/gem5/resources/resource.py b/src/python/gem5/resources/resource.py
index 0b9b128..b316f7d 100644
--- a/src/python/gem5/resources/resource.py
+++ b/src/python/gem5/resources/resource.py
@@ -73,7 +73,7 @@
     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.

--
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: 3
Gerrit-Owner: Bobby Bruce <[email protected]>
Gerrit-Reviewer: Bobby Bruce <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to