Author: phd
Date: Sun May 11 09:54:16 2014
New Revision: 4735
Log:
Merge revision 4734 from branch 1.7: no need to work around a bug in Decimal
Modified:
SQLObject/trunk/sqlobject/converters.py
SQLObject/trunk/sqlobject/tests/test_decimal.py
Modified: SQLObject/trunk/sqlobject/converters.py
==============================================================================
--- SQLObject/trunk/sqlobject/converters.py Sun May 11 09:53:02 2014 (r4734)
+++ SQLObject/trunk/sqlobject/converters.py Sun May 11 09:54:16 2014 (r4735)
@@ -164,8 +164,7 @@
registerConverter(datetime.time, TimeConverter)
def DecimalConverter(value, db):
- # See http://mail.python.org/pipermail/python-dev/2008-March/078189.html
- return str(value.to_eng_string()) # Convert to str to work around a bug in Python 2.5.2
+ return value.to_eng_string()
registerConverter(Decimal, DecimalConverter)
Modified: SQLObject/trunk/sqlobject/tests/test_decimal.py
==============================================================================
--- SQLObject/trunk/sqlobject/tests/test_decimal.py Sun May 11 09:53:02 2014 (r4734)
+++ SQLObject/trunk/sqlobject/tests/test_decimal.py Sun May 11 09:54:16 2014 (r4735)
@@ -49,14 +49,3 @@
d._SO_validatorState) == Decimal("10.01")
assert DecimalTable.sqlmeta.columns['col3'].from_python(Decimal('10.01'),
d._SO_validatorState) == "10.0100"
-
- # See http://mail.python.org/pipermail/python-dev/2008-March/078189.html
- if isinstance(Decimal(u'123').to_eng_string(), unicode): # a bug in Python 2.5.2
- def test_3_unicode():
- setupClass(DecimalTable)
- d = DecimalTable(name='test', col1=Decimal(u"21.12"),
- col2='10.01', col3='10.01')
- assert d.col1 == Decimal("21.12")
- d = DecimalTable(name=unicode('', 'koi8-r'), col1=Decimal(u"21.12"),
- col2='10.01', col3='10.01')
- assert d.col1 == Decimal("21.12")
|