From 381e8313ed191ae8e440a9ba3805d5322c769ea7 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 20 Jul 2017 10:32:28 +0100 Subject: Make error message more informative It's easier to identify a malformed variable assignment if we print it out. --- mesonbuild/modules/pkgconfig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/modules/pkgconfig.py') diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index 75a6ad2..5d98167 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -155,11 +155,11 @@ class PkgConfigModule(ExtensionModule): # foo=bar=baz is ('foo', 'bar=baz') l = var.split('=', 1) if len(l) < 2: - raise mesonlib.MesonException('Variables must be in \'name=value\' format') + raise mesonlib.MesonException('Invalid variable "{}". Variables must be in \'name=value\' format'.format(var)) name, value = l[0].strip(), l[1].strip() if not name or not value: - raise mesonlib.MesonException('Variables must be in \'name=value\' format') + raise mesonlib.MesonException('Invalid variable "{}". Variables must be in \'name=value\' format'.format(var)) # Variable names must not contain whitespaces if any(c.isspace() for c in name): -- cgit v1.1