fix python binding of create_torrent

This commit is contained in:
arvidn 2017-02-17 00:37:55 -05:00 committed by Arvid Norberg
parent 116802fcdf
commit 799cd8163b
2 changed files with 2 additions and 2 deletions

View File

@ -196,7 +196,7 @@ void bind_create_torrent()
class_<create_torrent>("create_torrent", no_init)
.def(init<file_storage&>())
.def(init<torrent_info const&, int>((arg("ti"), arg("version") = LIBTORRENT_VERSION_NUM)))
.def(init<torrent_info const&, bool>((arg("ti"), arg("use_preformatted") = false)))
.def(init<file_storage&, int, int, int>((arg("storage"), arg("piece_size") = 0
, arg("pad_file_limit") = -1, arg("flags") = int(libtorrent::create_torrent::optimize_alignment))))

View File

@ -13,7 +13,7 @@ class test_create_torrent(unittest.TestCase):
def test_from_torrent_info(self):
ti = lt.torrent_info('unordered.torrent')
ct = lt.create_torrent(ti)
ct = lt.create_torrent(ti, True)
entry = ct.generate()
content = lt.bencode(entry).strip()
with open('unordered.torrent', 'rb') as f: