aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2007-09-16 19:46:07 +0200
committerOlivier Tilloy <olivier@tilloy.net>2007-09-16 19:46:07 +0200
commit7b7f5662bc7bff7d3e36247d9df9a5e3dd5d0182 (patch)
treee65bbcba7506e1362bf2f542001c40428388722a
parentd79143ade7fab1ce8a07c9a8a09cf9a58a4f8b08 (diff)
downloadpyexiv2-7b7f5662bc7bff7d3e36247d9df9a5e3dd5d0182.tar.gz
Fixed a bug reported by Damon Lynch: due to interface changes for exceptions management in libexiv2 0.13, libpyexiv2 would not compile against versions >= 0.13.
-rw-r--r--src/libpyexiv2.cpp8
-rw-r--r--todo1
2 files changed, 8 insertions, 1 deletions
diff --git a/src/libpyexiv2.cpp b/src/libpyexiv2.cpp
index 4bd515e..5c3ecde 100644
--- a/src/libpyexiv2.cpp
+++ b/src/libpyexiv2.cpp
@@ -362,7 +362,13 @@ namespace LibPyExiv2
void translateExiv2Error(Exiv2::Error const& e)
{
// Use the Python 'C' API to set up an exception object
- const char* message = e.what().c_str();
+
+ // Building a C++ string first allows this code to compile with all
+ // versions of libexiv2 (< 0.13 and >= 0.13), because the way exceptions
+ // are handled in libexiv2 was changed in 0.13.
+ const std::string sMessage(e.what());
+ const char* message = sMessage.c_str();
+
// The type of the Python exception depends on the error code
// Warning: this piece of code should be updated in case the error codes
// defined by Exiv2 (file 'src/error.cpp') are changed
diff --git a/todo b/todo
index 31613f7..f6418c6 100644
--- a/todo
+++ b/todo
@@ -1,5 +1,6 @@
todo list
+- Reflect changes from src/error.cpp in libexiv2 to src/libpyexiv2.cpp: new error messages, error codes changed
- Add a 'doc' builder to the SConstruct to build the module's documentation
- Rewrite the exiv2 command-line tool and the test binaries in Python and (Python) scripts to run the same tests that are run to test exiv2
- Write a complete documentation for the binding and it uses