fix python3 portability issue in python binding

This commit is contained in:
arvidn 2017-05-21 08:25:33 -04:00 committed by Arvid Norberg
parent c7bb9f23ad
commit 387f3ba0ea
3 changed files with 5 additions and 4 deletions

View File

@ -1,3 +1,4 @@
* fix python3 portability issue in python binding
* delay 5 seconds before reconnecting socks5 proxy for UDP ASSOCIATE
* fix NAT-PMP crash when removing a mapping at the wrong time
* improve path sanitization (filter unicode text direction characters)

View File

@ -7,6 +7,7 @@
#include <libtorrent/aux_/disable_warnings_push.hpp>
#include <boost/python.hpp>
#include <boost/python/stl_iterator.hpp>
#include <libtorrent/aux_/disable_warnings_pop.hpp>
#endif

View File

@ -106,11 +106,10 @@ namespace
void make_settings_pack(lt::settings_pack& p, dict const& sett_dict)
{
list iterkeys = (list)sett_dict.keys();
int const len = boost::python::len(iterkeys);
for (int i = 0; i < len; i++)
stl_input_iterator<std::string> i(sett_dict.keys()), end;
for (; i != end; ++i)
{
std::string const key = extract<std::string>(iterkeys[i]);
std::string const key = *i;
int sett = setting_by_name(key);
if (sett < 0)