Changeset 6ef15af in rtems-central for rtemsspec/items.py


Ignore:
Timestamp:
01/22/21 05:39:55 (16 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
6f5da22
Parents:
0619f08
git-author:
Sebastian Huber <sebastian.huber@…> (01/22/21 05:39:55)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/22/21 05:53:33)
Message:

items: Improve identifier to item error message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtemsspec/items.py

    r0619f08 r6ef15af  
    503503            uid, key_path = uid_key_path, "/_uid"
    504504        if uid == ".":
     505            if prefix is None:
     506                prefix = "/".join(self._prefix)
    505507            if item is None:
    506508                item = self._item
    507             if prefix is None:
    508                 prefix = "/".join(self._prefix)
    509509        else:
    510             item = self._item.map(uid)
    511510            prefix = ""
     511            try:
     512                item = self._item.map(uid)
     513            except KeyError as err:
     514                msg = (f"item '{uid}' relative to {self._item.spec} "
     515                       f"specified by '{identifier}' does not exist")
     516                raise ValueError(msg) from err
    512517        key_path = normalize_key_path(key_path, prefix)
    513518        value = item.get_by_normalized_key_path(key_path,
Note: See TracChangeset for help on using the changeset viewer.