Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d6d0941

Browse files
author
Apostolos Bessas
committed
Handle case of traffic_allocation being None
In Python 3 you cannot compare None with an integer. As a result, the localhost implementation fails.
1 parent 7f68a91 commit d6d0941

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

splitio/splits.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ def __init__(self, name, seed, killed, default_treatment, traffic_type_name,
7676
self._change_number = change_number
7777
self._conditions = conditions if conditions is not None else []
7878

79-
if traffic_allocation >= 0 and traffic_allocation <= 100:
79+
if traffic_allocation is None:
80+
self._traffic_allocation = 100
81+
elif traffic_allocation >= 0 and traffic_allocation <= 100:
8082
self._traffic_allocation = traffic_allocation
8183
else:
8284
self._traffic_allocation = 100

0 commit comments

Comments
 (0)