Revision: 615
http://svn.sourceforge.net/pygccxml/?rev=615&view=rev
Author: mbaas
Date: 2006-10-03 03:04:38 -0700 (Tue, 03 Oct 2006)
Log Message:
-----------
Improved error messages (the declaration that caused the error is now mentioned in the exception description).
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/function_transformers/arg_policies.py
Modified: pyplusplus_dev/pyplusplus/function_transformers/arg_policies.py
===================================================================
--- pyplusplus_dev/pyplusplus/function_transformers/arg_policies.py 2006-10-03 07:01:44 UTC (rev 614)
+++ pyplusplus_dev/pyplusplus/function_transformers/arg_policies.py 2006-10-03 10:04:38 UTC (rev 615)
@@ -51,7 +51,7 @@
reftype = arg.type
if not (isinstance(reftype, declarations.reference_t) or
isinstance(reftype, declarations.pointer_t)):
- raise ValueError, 'Output variable %d ("%s") must be a reference or a pointer (got %s)'%(self.idx, arg.name, arg.type)
+ raise ValueError, '%s\nOutput variable %d ("%s") must be a reference or a pointer (got %s)'%(sm.decl, self.idx, arg.name, arg.type)
# Declare a local variable that will receive the output value
self.local_var = sm.wrapper_func.declare_local(arg.name, str(reftype.base))
@@ -106,7 +106,7 @@
reftype = arg.type
if not (isinstance(reftype, declarations.reference_t) or
isinstance(reftype, declarations.pointer_t)):
- raise ValueError, 'Input variable %d ("%s") must be a reference or a pointer (got %s)'%(self.idx, arg.name, arg.type)
+ raise ValueError, '%s\nInput variable %d ("%s") must be a reference or a pointer (got %s)'%(sm.decl, self.idx, arg.name, arg.type)
# Create an equivalent argument that is not a reference type
noref_arg = declarations.argument_t(name=arg.name, type=arg.type.base, default_value=arg.default_value)
@@ -142,7 +142,7 @@
reftype = arg.type
if not (isinstance(reftype, declarations.reference_t) or
isinstance(reftype, declarations.pointer_t)):
- raise ValueError, 'InOut variable %d ("%s") must be a reference or a pointer (got %s)'%(self.idx, arg.name, arg.type)
+ raise ValueError, '%s\nInOut variable %d ("%s") must be a reference or a pointer (got %s)'%(sm.decl, self.idx, arg.name, arg.type)
# Create an equivalent argument that is not a reference type
noref_arg = declarations.argument_t(name=arg.name, type=arg.type.base, default_value=arg.default_value)
@@ -213,7 +213,7 @@
if not (isinstance(arg.type, declarations.pointer_t) or
isinstance(arg.type, declarations.array_t)):
- raise ValueError, "Argument %d (%s) must be a pointer."%(self.idx, arg.name)
+ raise ValueError, "%s\nArgument %d (%s) must be a pointer."%(sm.decl, self.idx, arg.name)
# Declare a variable that will hold the Python list
# (this will be the input of the Python call in the virtual function)
@@ -305,7 +305,7 @@
if not (isinstance(arg.type, declarations.pointer_t) or
isinstance(arg.type, declarations.array_t)):
- raise ValueError, "Argument %d (%s) must be a pointer."%(self.idx, arg.name)
+ raise ValueError, "%s\nArgument %d (%s) must be a pointer."%(sm.decl, self.idx, arg.name)
self.argname = arg.name
self.basetype = str(arg.type.base).replace("const", "").strip()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|