Commits

Jeff Hardy  committed b47700d

- remove print stmts
- handle None results

  • Participants
  • Parent commits becb0ba

Comments (0)

Files changed (2)

File dbapi/dbapi/generic.py

 
     def __init__(self, connection):
         self.id = random.randint(1, 1000)
-        print "Creating cursor", self.id
+        # print "Creating cursor", self.id
         
         self.connection = connection
         self.description = None
             self.reader = None
     
     def execute(self, operation, parameters=None, parameter_names=None):
-        print "adonet2dbapi: executing '" + str(operation) + "' with '" + str(parameters) + "'"
+        # print "adonet2dbapi: executing '" + str(operation) + "' with '" + str(parameters) + "'"
         
         self._reset()
         command = self.connection.connection.CreateCommand()
 
     def close(self):
         '''Close the cursor. No further queries will be possible.'''
-        print "Closing cursor", self.id
+        # print "Closing cursor", self.id
         self._reset()
         if self.connection:
             self.connection = None

File dbapi/sqlite3/dbapi2.py

 
     def fetchone(self):
         r = GenericCursor.fetchone(self)
-        return tuple(_to_python(v) for v in r)
+        return tuple(_to_python(v) for v in r) if r else None
     
     def fetchmany(self, size=None):
         result = GenericCursor.fetchmany(self, size)
-        return [tuple(_to_python(v) for v in r) for r in result]
+        return [tuple(_to_python(v) for v in r) for r in result if r]
         
     def fetchall(self):
         result = GenericCursor.fetchall(self)