File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -1096,7 +1096,6 @@ def test_invalid_array_size(self):
10961096 self .assertRaises (ValueError , setter , - 3 )
10971097 self .assertRaises (OverflowError , setter , UINT32_MAX + 1 )
10981098
1099- @unittest .expectedFailure # TODO: RUSTPYTHON fetchmany behavior with exhausted cursor differs
11001099 def test_fetchmany (self ):
11011100 # no active SQL statement
11021101 res = self .cu .fetchmany ()
Original file line number Diff line number Diff line change @@ -1900,10 +1900,14 @@ mod _sqlite3 {
19001900 } ;
19011901
19021902 let mut list = vec ! [ ] ;
1903- while let PyIterReturn :: Return ( row) = Cursor :: next ( zelf, vm) ? {
1904- list. push ( row) ;
1905- if max_rows > 0 && list. len ( ) as c_int >= max_rows {
1906- break ;
1903+ let mut remaining = max_rows;
1904+ while remaining > 0 {
1905+ match Cursor :: next ( zelf, vm) ? {
1906+ PyIterReturn :: Return ( row) => {
1907+ list. push ( row) ;
1908+ remaining -= 1 ;
1909+ }
1910+ PyIterReturn :: StopIteration ( _) => break ,
19071911 }
19081912 }
19091913 Ok ( list)
You can’t perform that action at this time.
0 commit comments