From ba9444da85a6b2075c9e167b2c03a84d94b3b776 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 17 Aug 2012 14:07:10 +0530 Subject: [PATCH] fixed msgprint bug, check if argument raise_exception is a class, before checking for subclass --- py/webnotes/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py/webnotes/__init__.py b/py/webnotes/__init__.py index de41f84f23..20cbae4fdd 100644 --- a/py/webnotes/__init__.py +++ b/py/webnotes/__init__.py @@ -98,7 +98,8 @@ def msgprint(msg, small=0, raise_exception=0, as_table=False): message_log.append((small and '__small:' or '')+cstr(msg or '')) if raise_exception: - if issubclass(raise_exception, Exception): + import inspect + if inspect.isclass(raise_exception) and issubclass(raise_exception, Exception): raise raise_exception, msg else: raise ValidationError, msg