#NEWLINE# def fetchmany( self , size = None ) : #NEWLINE# #INDENT# self . _wait_to_finish ( ) #NEWLINE# if ( not self . has_result_set ) : #NEWLINE# #INDENT# raise ProgrammingError ( 'Tried to fetch but no results.' ) #NEWLINE# #UNINDENT# if ( size is None ) : #NEWLINE# #INDENT# size = self . arraysize #NEWLINE# #UNINDENT# log . debug ( 'Fetching up to %s result rows' , size ) #NEWLINE# local_buffer = [ ] #NEWLINE# i = 0 #NEWLINE# while ( i < size ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# local_buffer . append ( next ( self ) ) #NEWLINE# i += 1 #NEWLINE# #UNINDENT# except StopIteration : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# return local_buffer