From 4af9d8735ffaffea2503b6133114d9a1e489f864 Mon Sep 17 00:00:00 2001 From: James Vega Date: Sun, 11 Apr 2010 10:15:39 -0400 Subject: [PATCH] Make registry.Regexp.error mimic registry.Value.error Regexp.error can't directly call Value.error because it's providing extra information, so it needs to build the InvalidRegistryValue exception itself and raise it. Closes: Sf#2985241 Signed-off-by: James Vega (cherry picked from commit ef8bd817e8b62ede76aa7501a9a8d69af7408efc) Signed-off-by: Daniel Folkinshteyn --- src/registry.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/registry.py b/src/registry.py index 19b533085..2497b4390 100644 --- a/src/registry.py +++ b/src/registry.py @@ -543,7 +543,10 @@ class Regexp(Value): self.__parent.__init__(*args, **kwargs) def error(self, e): - self.__parent.error('Value must be a regexp of the form %s' % e) + s = 'Value must be a regexp of the form m/.../ or /.../. %s' % e + e = InvalidRegistryValue(s) + e.value = self + raise e def set(self, s): try: