Skip to content

Commit 97506b4

Browse files
committed
Handle zero min_instances
1 parent 5bc2a80 commit 97506b4

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

pk_helper.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
2-
3-
41
def limit_instances(count,cmin,cmax):
5-
cmin = 1 if not cmin else int(cmin)
6-
cmax = cmin if not cmax else max(int(cmax),cmin)
7-
count = max(min(int(count),cmax),cmin) if count else cmin
8-
return count,cmin,cmax
9-
2+
cmin = 1 if cmin is None else int(cmin)
3+
cmax = cmin if cmax is None else max(int(cmax),cmin)
4+
count = cmin if count is None else max(min(int(count),cmax),cmin)
5+
return count,cmin,cmax

0 commit comments

Comments
 (0)