Author: phd
Date: Sun May 11 09:53:02 2014
New Revision: 4734
Log:
Python 2.5 is no longer supported: no need to work around a bug in Decimal
Modified:
SQLObject/branches/1.7/sqlobject/converters.py
SQLObject/branches/1.7/sqlobject/tests/test_decimal.py
Modified: SQLObject/branches/1.7/sqlobject/converters.py
==============================================================================
--- SQLObject/branches/1.7/sqlobject/converters.py Sat May 10 12:18:55 2014 (r4733)
+++ SQLObject/branches/1.7/sqlobject/converters.py Sun May 11 09:53:02 2014 (r4734)
@@ -180,8 +180,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/branches/1.7/sqlobject/tests/test_decimal.py
==============================================================================
--- SQLObject/branches/1.7/sqlobject/tests/test_decimal.py Sat May 10 12:18:55 2014 (r4733)
+++ SQLObject/branches/1.7/sqlobject/tests/test_decimal.py Sun May 11 09:53:02 2014 (r4734)
@@ -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")
|