Skip to content

Commit 65e452d

Browse files
authored
Merge pull request #27 from peopledoc/lorenzomorandini-fix_stopIteration_warning
Fix stop iteration warning
2 parents 32a38ce + b8e46b8 commit 65e452d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# master (unreleased)
44

55
- Changing Github Organization from ``novafloss`` to ``peopledoc`` (#24),
6-
- Added documentation to install and bootstrap the demo app.
6+
- Added documentation to install and bootstrap the demo app (#26),
7+
- Removed `PendingDeprecationWarning` due to `StopIteration` usage (#23).
78

89
## 1.3.0 (2017-09-14)
910

chunkator/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def chunkator_page(source_qs, chunk_size, query_log=None):
4242
nb_items = len(page)
4343

4444
if nb_items == 0:
45-
raise StopIteration
45+
return
4646

4747
last_item = page[-1]
4848
# source_qs._fields exists *and* is not none when using "values()"
@@ -54,7 +54,7 @@ def chunkator_page(source_qs, chunk_size, query_log=None):
5454
yield page
5555

5656
if nb_items < chunk_size:
57-
raise StopIteration
57+
return
5858

5959

6060
def chunkator(source_qs, chunk_size, query_log=None):

0 commit comments

Comments
 (0)