@@ -103,39 +103,39 @@ def process(value):
103103 """Render a literal value, escaping as needed."""
104104
105105 # bool
106- if isinstance (value , bool ) :
106+ if type (value ) is bool :
107107 return sqlalchemy .types .Boolean ().literal_processor (dialect )(value )
108108
109109 # datetime.date
110- elif isinstance (value , datetime .date ) :
110+ elif type (value ) is datetime .date :
111111 return sqlalchemy .types .String ().literal_processor (dialect )(value .strftime ("%Y-%m-%d" ))
112112
113113 # datetime.datetime
114- elif isinstance (value , datetime .datetime ) :
114+ elif type (value ) is datetime .datetime :
115115 return sqlalchemy .types .String ().literal_processor (dialect )(value .strftime ("%Y-%m-%d %H:%M:%S" ))
116116
117117 # datetime.time
118- elif isinstance (value , datetime .time ) :
118+ elif type (value ) is datetime .time :
119119 return sqlalchemy .types .String ().literal_processor (dialect )(value .strftime ("%H:%M:%S" ))
120120
121121 # float
122- elif isinstance (value , float ) :
122+ elif type (value ) is float :
123123 return sqlalchemy .types .Float ().literal_processor (dialect )(value )
124124
125125 # int
126- elif isinstance (value , int ) :
126+ elif type (value ) is int :
127127 return sqlalchemy .types .Integer ().literal_processor (dialect )(value )
128128
129129 # long
130- elif sys .version_info .major != 3 and isinstance (value , long ) :
130+ elif sys .version_info .major != 3 and type (value ) is long :
131131 return sqlalchemy .types .Integer ().literal_processor (dialect )(value )
132132
133133 # str
134- elif isinstance (value , str ) :
134+ elif type (value ) is str :
135135 return sqlalchemy .types .String ().literal_processor (dialect )(value )
136136
137137 # None
138- elif isinstance (value , sqlalchemy .sql .elements .Null ) :
138+ elif type (value ) is sqlalchemy .sql .elements .Null :
139139 return sqlalchemy .types .NullType ().literal_processor (dialect )(value )
140140
141141 # Unsupported value
@@ -192,7 +192,7 @@ def process(value):
192192 rows = [dict (row ) for row in result .fetchall ()]
193193 for row in rows :
194194 for column in row :
195- if isinstance (row [column ], decimal .Decimal ) :
195+ if type (row [column ]) is decimal .Decimal :
196196 row [column ] = float (row [column ])
197197 ret = rows
198198
0 commit comments