forked from premiere/premiere-libtorrent
Merge pull request #368 from arvidn/python-datetime
use datetime type for time_duration in python binding
This commit is contained in:
commit
3efe85849e
|
@ -31,8 +31,13 @@ struct chrono_time_duration_to_python
|
||||||
{
|
{
|
||||||
static PyObject* convert(lt::time_duration const& d)
|
static PyObject* convert(lt::time_duration const& d)
|
||||||
{
|
{
|
||||||
return incref(object(lt::duration_cast<lt::milliseconds>(d).count()
|
object result = datetime_timedelta(
|
||||||
/ 1000.f).ptr());
|
0 // days
|
||||||
|
, 0 // seconds
|
||||||
|
, lt::total_microseconds(d)
|
||||||
|
);
|
||||||
|
|
||||||
|
return incref(result.ptr());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue