From 1f7fc23ae0ef88baf685c77b7e760604e2d9382d Mon Sep 17 00:00:00 2001 From: Florian Schanda Date: Tue, 20 Jun 2023 09:10:51 +0200 Subject: [PATCH] Improve error message for duplicate items --- lobster/io.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lobster/io.py b/lobster/io.py index 7f5b5c9c..ccd77040 100644 --- a/lobster/io.py +++ b/lobster/io.py @@ -111,9 +111,10 @@ def lobster_read(mh, filename, level, items, source_info=None): if item.tag.key() in items: mh.error(item.location, - "duplicate definition, " + "duplicate definition of %s, " "previously defined at %s" % - items[item.tag.key()].location.to_string()) + (item.tag.key(), + items[item.tag.key()].location.to_string())) if source_info is not None: item.perform_source_checks(source_info)