[rtems-central commit] items: Fix item used for the UID mapping
Sebastian Huber
sebh at rtems.org
Wed Feb 17 17:48:06 UTC 2021
Module: rtems-central
Branch: master
Commit: eb6dd90665bc4818ceb36c10f82fb4073094e6b2
Changeset: http://git.rtems.org/rtems-central/commit/?id=eb6dd90665bc4818ceb36c10f82fb4073094e6b2
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Feb 9 08:26:14 2021 +0100
items: Fix item used for the UID mapping
---
rtemsspec/items.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/rtemsspec/items.py b/rtemsspec/items.py
index 666f631..bfd0dac 100644
--- a/rtemsspec/items.py
+++ b/rtemsspec/items.py
@@ -501,17 +501,17 @@ class ItemMapper:
uid, key_path = uid_key_path[:colon], uid_key_path[colon + 1:]
else:
uid, key_path = uid_key_path, "/_uid"
+ if item is None:
+ item = self._item
if uid == ".":
if prefix is None:
prefix = "/".join(self._prefix)
- if item is None:
- item = self._item
else:
prefix = ""
try:
- item = self._item.map(uid)
+ item = item.map(uid)
except KeyError as err:
- msg = (f"item '{uid}' relative to {self._item.spec} "
+ msg = (f"item '{uid}' relative to {item.spec} "
f"specified by '{identifier}' does not exist")
raise ValueError(msg) from err
key_path = normalize_key_path(key_path, prefix)
More information about the vc
mailing list