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-by: Jason Lowe-Power <>
Maintainer: Jason Lowe-Power <>
Tested-by: kokoro <>
diff --git a/src/python/gem5/resources/ b/src/python/gem5/resources/
index 0b9b128..b316f7d 100644
--- a/src/python/gem5/resources/
+++ b/src/python/gem5/resources/
@@ -73,7 +73,7 @@
-    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.