[C++-SIG] Re: bug in setattr_handler?

Barry Scott barry at scottb.demon.co.uk
Wed May 17 23:47:27 CEST 2000


If we do not catch the exception Python will abort - remember that Python is C
code not C++ and cannot deal with exceptions.

The C++ exception will be converted into a Python exception.

If you test your setatr version of the example you should see the exception
in Python.

		BArry

> -----Original Message-----
> From: c++-sig-admin at python.org [mailto:c++-sig-admin at python.org]On
> Behalf Of Phil Austin
> Sent: 17 May 2000 22:27
> To: Barry Scott; c++-sig at python.org
> Subject: [C++-SIG] Re: bug in setattr_handler?
> 
> 
> Phil Austin writes:
>  >   		}
>  >   	catch( Py::Exception & )
>  >   		{
>  > ! 		  //return 0; ignore all exceptions??
>  > ! 		  return Py::Null();
>  >   		}
>  >   	}
> 
> Obviously -- this doesn't compile, given the signature
> for setattr_handler. Since I don't understand why
> these handlers catch the exceptions in the first place (instead
> of letting them propagate), I'll let somebody
> else propose the correct fix.
> 
> Regards, Phil
> 
> 
> 
> 
> _______________________________________________
> C++-SIG maillist  -  C++-SIG at python.org
> http://www.python.org/mailman/listinfo/c++-sig
> 




More information about the Cplusplus-sig mailing list