Revised
- 1 August 2003
+ 11 September 2003
© Copyright Dave
diff --git a/src/converter/registry.cpp b/src/converter/registry.cpp
index 2e747a14..ce12ec81 100644
--- a/src/converter/registry.cpp
+++ b/src/converter/registry.cpp
@@ -9,6 +9,7 @@
#include
#include
+#include
#if defined(__APPLE__) && defined(__MACH__) && defined(__GNUC__) \
&& __GNUC__ == 3 && __GNUC_MINOR__ == 3 && !defined(__APPLE_CC__)
@@ -161,8 +162,16 @@ namespace registry
assert(slot == 0); // we have a problem otherwise
if (slot != 0)
{
- throw std::runtime_error(
- "trying to register to_python_converter for a type which already has a registered to_python_converter");
+ std::string msg(
+ "to-Python converter for "
+ + lexical_cast(source_t)
+ + " already registered; second conversion method ignored."
+ );
+
+ if ( ::PyErr_Warn( NULL, const_cast(msg.c_str()) ) )
+ {
+ throw_error_already_set();
+ }
}
slot = f;
}