Changeset 838
- Timestamp:
- 03/12/07 20:34:49 (1 year ago)
- Files:
-
- pg8000/trunk/pg8000.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pg8000/trunk/pg8000.py
r836 r838 85 85 Error = Error 86 86 InterfaceError = InterfaceError 87 InternalError = InternalError 87 88 DatabaseError = DatabaseError 88 89 DataError = DataError … … 273 274 self.arraysize = 1 274 275 276 rowcount = property(lambda self: self._getRowCount()) 277 def _getRowCount(self): 278 return -1 279 280 description = property(lambda self: self._getDescription()) 281 def _getDescription(self): 282 return None 283 275 284 def execute(self, operation, args=()): 285 if self.cursor == None: 286 raise InterfaceError("cursor is closed") 276 287 new_query, new_args = DBAPI.convert_paramstyle(DBAPI.paramstyle, operation, args) 277 288 self.cursor.execute(new_query, *new_args) … … 282 293 283 294 def fetchone(self): 295 if self.cursor == None: 296 raise InterfaceError("cursor is closed") 284 297 return self.cursor.read_tuple() 285 298 … … 293 306 294 307 def fetchall(self): 308 if self.cursor == None: 309 raise InterfaceError("cursor is closed") 295 310 return tuple(self.cursor.iterate_tuple()) 296 311 … … 321 336 # statements on other threads. Support for that type of lock will 322 337 # be done later. 338 if self.conn == None: 339 raise InterfaceError("connection is closed") 323 340 self.conn.commit() 324 341 self.conn.begin() … … 326 343 def rollback(self): 327 344 # see bug description in commit. 345 if self.conn == None: 346 raise InterfaceError("connection is closed") 328 347 self.conn.rollback() 329 348 self.conn.begin() … … 1452 1471 py_types = { 1453 1472 int: {"tid": 1700, "txt_out": numeric_out}, 1473 long: {"tid": 1700, "txt_out": numeric_out}, 1454 1474 str: {"tid": 25, "txt_out": textout}, 1455 1475 unicode: {"tid": 25, "txt_out": textout}, … … 1466 1486 23: {"txt_in": int4in, "bin_in": int4recv, "prefer": "bin"}, 1467 1487 25: {"txt_in": varcharin}, # TEXT type 1488 26: {"txt_in": numeric_in}, # oid type 1468 1489 700: {"txt_in": float4in, "bin_in": float4recv, "prefer": "bin"}, 1469 1490 701: {"txt_in": float8in, "bin_in": float8recv, "prefer": "bin"},
