Skip to content

Commit 3b57de7

Browse files
committed
make linters happy
1 parent 200c9d4 commit 3b57de7

File tree

1 file changed

+2
-4
lines changed
  • hypothesis-python/src/hypothesis/internal/conjecture

1 file changed

+2
-4
lines changed

hypothesis-python/src/hypothesis/internal/conjecture/data.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1098,9 +1098,7 @@ def ir_value_permitted(value, ir_type, kwargs):
10981098
elif ir_type == "bytes":
10991099
if len(value) < kwargs["min_size"]:
11001100
return False
1101-
if kwargs["max_size"] is not None and len(value) > kwargs["max_size"]:
1102-
return False
1103-
return True
1101+
return kwargs["max_size"] is None or len(value) <= kwargs["max_size"]
11041102
elif ir_type == "boolean":
11051103
if kwargs["p"] <= 2 ** (-64):
11061104
return value is False
@@ -1684,6 +1682,7 @@ def draw_bytes(
16841682
max_size = COLLECTION_DEFAULT_MAX_SIZE
16851683

16861684
assert forced is None or min_size <= len(forced) <= max_size
1685+
assert self._cd is not None
16871686

16881687
buf = bytearray()
16891688
average_size = min(
@@ -1705,7 +1704,6 @@ def draw_bytes(
17051704
# implicit conversion from bytes to int by indexing here
17061705
forced_i = forced[elements.count - 1]
17071706

1708-
assert self._cd is not None
17091707
buf += self._cd.draw_bits(
17101708
8, forced=forced_i, fake_forced=fake_forced
17111709
).to_bytes(1, "big")

0 commit comments

Comments
 (0)