diff --git a/bindings/python/src/torrent_status.cpp b/bindings/python/src/torrent_status.cpp index a7521898c..2f34ac089 100644 --- a/bindings/python/src/torrent_status.cpp +++ b/bindings/python/src/torrent_status.cpp @@ -105,7 +105,7 @@ void bind_torrent_status() .def_readonly("time_since_download", &torrent_status::time_since_download) #endif .def_readonly("errc", &torrent_status::errc) - .def_readonly("error_file", &torrent_status::error_file) + .add_property("error_file", make_getter(&torrent_status::error_file, by_value())) .def_readonly("name", &torrent_status::name) .def_readonly("save_path", &torrent_status::save_path) .def_readonly("added_time", &torrent_status::added_time) @@ -129,7 +129,7 @@ void bind_torrent_status() .add_property("active_duration", make_getter(&torrent_status::active_duration, by_value())) .add_property("finished_duration", make_getter(&torrent_status::finished_duration, by_value())) .add_property("seeding_duration", make_getter(&torrent_status::seeding_duration, by_value())) - .def_readonly("flags", &torrent_status::flags) + .add_property("flags", make_getter(&torrent_status::flags, by_value())) ; enum_("states") diff --git a/bindings/python/test.py b/bindings/python/test.py index 089e7e2b9..257d7b189 100644 --- a/bindings/python/test.py +++ b/bindings/python/test.py @@ -76,6 +76,7 @@ class test_torrent_handle(unittest.TestCase): # also test the overload that takes a list of piece->priority mappings self.h.prioritize_pieces([(0, 1)]) self.assertEqual(self.h.piece_priorities(), [1]) + def test_torrent_handle_in_set(self): self.setup() torrents = set() @@ -181,6 +182,8 @@ class test_torrent_handle(unittest.TestCase): # make sure we can compare torrent_status objects st2 = self.h.status() self.assertEqual(st2, st) + print(st2.error_file) + print(st2.flags) def test_read_resume_data(self):