diff --git a/bindings/python/src/alert.cpp b/bindings/python/src/alert.cpp index 994eb880d..20f7e6998 100644 --- a/bindings/python/src/alert.cpp +++ b/bindings/python/src/alert.cpp @@ -575,7 +575,7 @@ void bind_alert() class_, noncopyable>( "portmap_error_alert", no_init) - .def_readonly("mapping", &portmap_error_alert::mapping) + .add_property("mapping", make_getter(&portmap_error_alert::mapping, by_value())) .def_readonly("error", &portmap_error_alert::error) .def_readonly("map_transport", &portmap_error_alert::map_transport) #ifndef TORRENT_NO_DEPRECATE @@ -586,7 +586,7 @@ void bind_alert() ; class_, noncopyable>("portmap_alert", no_init) - .def_readonly("mapping", &portmap_alert::mapping) + .add_property("mapping", make_getter(&portmap_alert::mapping, by_value())) .def_readonly("external_port", &portmap_alert::external_port) .def_readonly("map_protocol", &portmap_alert::map_protocol) .def_readonly("map_transport", &portmap_alert::map_transport) diff --git a/bindings/python/src/converters.cpp b/bindings/python/src/converters.cpp index 8945d8345..b4d862756 100644 --- a/bindings/python/src/converters.cpp +++ b/bindings/python/src/converters.cpp @@ -19,6 +19,7 @@ #include "libtorrent/file_storage.hpp" // for file_flags_t #include "libtorrent/alert.hpp" #include "libtorrent/create_torrent.hpp" // for create_flags_t +#include "libtorrent/portmap.hpp" // for port_mapping_t #include using namespace boost::python; @@ -299,6 +300,7 @@ void bind_converters() to_python_converter>(); to_python_converter>(); + to_python_converter>(); to_python_converter>(); to_python_converter>(); to_python_converter>(); @@ -358,6 +360,7 @@ void bind_converters() to_strong_typedef(); to_strong_typedef(); + to_strong_typedef(); to_bitfield_flag(); to_bitfield_flag(); to_bitfield_flag();