Revision: 899
http://svn.sourceforge.net/pygccxml/?rev=899&view=rev
Author: roman_yakovenko
Date: 2007-02-10 13:40:21 -0800 (Sat, 10 Feb 2007)
Log Message:
-----------
if PyObject doesn't have len attribute don't try to make conversion
Modified Paths:
--------------
pyplusplus_dev/docs/troubleshooting_guide/automatic_conversion/tuples.hpp
Modified: pyplusplus_dev/docs/troubleshooting_guide/automatic_conversion/tuples.hpp
===================================================================
--- pyplusplus_dev/docs/troubleshooting_guide/automatic_conversion/tuples.hpp 2007-02-09 10:24:13 UTC (rev 898)
+++ pyplusplus_dev/docs/troubleshooting_guide/automatic_conversion/tuples.hpp 2007-02-10 21:40:21 UTC (rev 899)
@@ -152,7 +152,12 @@
return 0;
}
+ if( !PyObject_HasAttrString( py_obj, "__len__" ) ){
+ return 0;
+ }
+
python::object py_sequence( handle<>( borrowed( py_obj ) ) );
+
if( tuples::length< TTuple >::value != len( py_sequence ) ){
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|