summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2008-07-15 19:40:08 +0000
committerJason Kirtland <jek@discorporate.us>2008-07-15 19:40:08 +0000
commit8b12c8f1c2048a9ef6f19b66823bf6053efff565 (patch)
tree528de821fb080eaee04b077e25e2746150d2658f /lib/sqlalchemy
parent1d37472fdd1e4091fe2d158a21b27043fc8626f9 (diff)
downloadsqlalchemy-8b12c8f1c2048a9ef6f19b66823bf6053efff565.tar.gz
- Removed 2.3 Decimal compat
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/databases/firebird.py4
-rw-r--r--lib/sqlalchemy/databases/mssql.py2
-rw-r--r--lib/sqlalchemy/databases/mysql.py4
-rw-r--r--lib/sqlalchemy/databases/postgres.py4
-rw-r--r--lib/sqlalchemy/types.py3
-rw-r--r--lib/sqlalchemy/util.py14
6 files changed, 9 insertions, 22 deletions
diff --git a/lib/sqlalchemy/databases/firebird.py b/lib/sqlalchemy/databases/firebird.py
index aba834f64..53cd3a573 100644
--- a/lib/sqlalchemy/databases/firebird.py
+++ b/lib/sqlalchemy/databases/firebird.py
@@ -99,7 +99,7 @@ parameter when creating the queries::
"""
-import datetime, re
+import datetime, decimal, re
from sqlalchemy import exc, schema, types as sqltypes, sql, util
from sqlalchemy.engine import base, default
@@ -126,7 +126,7 @@ class FBNumeric(sqltypes.Numeric):
return None
else:
def process(value):
- if isinstance(value, util.decimal_type):
+ if isinstance(value, decimal.Decimal):
return float(value)
else:
return value
diff --git a/lib/sqlalchemy/databases/mssql.py b/lib/sqlalchemy/databases/mssql.py
index 1aea72a96..5852b2c43 100644
--- a/lib/sqlalchemy/databases/mssql.py
+++ b/lib/sqlalchemy/databases/mssql.py
@@ -44,7 +44,7 @@ from sqlalchemy.sql import compiler, expression, operators as sqlops, functions
from sqlalchemy.sql import compiler, expression, operators as sql_operators, functions as sql_functions
from sqlalchemy.engine import default, base
from sqlalchemy import types as sqltypes
-from sqlalchemy.util import Decimal as _python_Decimal
+from decimal import Decimal as _python_Decimal
MSSQL_RESERVED_WORDS = set(['function'])
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py
index 704abbe6d..a56e6ad79 100644
--- a/lib/sqlalchemy/databases/mysql.py
+++ b/lib/sqlalchemy/databases/mysql.py
@@ -153,7 +153,7 @@ Notes page on the wiki at http://www.sqlalchemy.org is a good resource for
timely information affecting MySQL in SQLAlchemy.
"""
-import datetime, inspect, re, sys
+import datetime, decimal, inspect, re, sys
from array import array as _array
from sqlalchemy import exc, log, schema, sql, util
@@ -338,7 +338,7 @@ class MSNumeric(sqltypes.Numeric, _NumericType):
def result_processor(self, dialect):
if not self.asdecimal:
def process(value):
- if isinstance(value, util.decimal_type):
+ if isinstance(value, decimal.Decimal):
return float(value)
else:
return value
diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py
index 9adade2a6..5d61b32ad 100644
--- a/lib/sqlalchemy/databases/postgres.py
+++ b/lib/sqlalchemy/databases/postgres.py
@@ -19,7 +19,7 @@ parameter when creating the queries::
postgres_returning=[empl.c.id, empl.c.salary]).execute().fetchall()
"""
-import random, re, string
+import decimal, random, re, string
from sqlalchemy import sql, schema, exc, util
from sqlalchemy.engine import base, default
@@ -55,7 +55,7 @@ class PGNumeric(sqltypes.Numeric):
return None
else:
def process(value):
- if isinstance(value, util.decimal_type):
+ if isinstance(value, decimal.Decimal):
return float(value)
else:
return value
diff --git a/lib/sqlalchemy/types.py b/lib/sqlalchemy/types.py
index 163a6d7c4..a03bf41bf 100644
--- a/lib/sqlalchemy/types.py
+++ b/lib/sqlalchemy/types.py
@@ -23,9 +23,10 @@ __all__ = [ 'TypeEngine', 'TypeDecorator', 'AbstractType',
import inspect
import datetime as dt
+from decimal import Decimal as _python_Decimal
from sqlalchemy import exc
-from sqlalchemy.util import pickle, Decimal as _python_Decimal
+from sqlalchemy.util import pickle
import sqlalchemy.util as util
NoneType = type(None)
diff --git a/lib/sqlalchemy/util.py b/lib/sqlalchemy/util.py
index ee2840cf5..9175e78f2 100644
--- a/lib/sqlalchemy/util.py
+++ b/lib/sqlalchemy/util.py
@@ -27,20 +27,6 @@ try:
except ImportError:
import pickle
-try:
- # Try the standard decimal for > 2.3 or the compatibility module
- # for 2.3, if installed.
- from decimal import Decimal
- decimal_type = Decimal
-except ImportError:
- def Decimal(arg):
- if Decimal.warn:
- warn("True Decimal types not available on this Python, "
- "falling back to floats.")
- Decimal.warn = False
- return float(arg)
- Decimal.warn = True
- decimal_type = float
try:
from operator import attrgetter