1
0
mirror of https://github.com/django/django.git synced 2024-12-23 09:36:06 +00:00

Refs #2443 -- fixed format_dtdelta on SQLite

A test failed on Python 2 32-bit.
This commit is contained in:
Anssi Kääriäinen 2014-12-23 12:01:58 +02:00 committed by Tim Graham
parent 962bb9b6bd
commit 227a4c48be

View File

@ -599,12 +599,12 @@ def _sqlite_format_dtdelta(conn, lhs, rhs):
- A string representing a datetime - A string representing a datetime
""" """
try: try:
if isinstance(lhs, int): if isinstance(lhs, six.integer_types):
lhs = str(decimal.Decimal(lhs) / decimal.Decimal(1000000)) lhs = str(decimal.Decimal(lhs) / decimal.Decimal(1000000))
real_lhs = parse_duration(lhs) real_lhs = parse_duration(lhs)
if real_lhs is None: if real_lhs is None:
real_lhs = backend_utils.typecast_timestamp(lhs) real_lhs = backend_utils.typecast_timestamp(lhs)
if isinstance(rhs, int): if isinstance(rhs, six.integer_types):
rhs = str(decimal.Decimal(rhs) / decimal.Decimal(1000000)) rhs = str(decimal.Decimal(rhs) / decimal.Decimal(1000000))
real_rhs = parse_duration(rhs) real_rhs = parse_duration(rhs)
if real_rhs is None: if real_rhs is None: