Exception behaviour changed
Version(["1"])Neither exception type subclasses the other.
The fast‑path added in the PR returns early after setting a handful of private attributes (e.g., `self._epoch = 0; self._pre = None; …; self._key_cache = None; return`). The base version took the full regex path and raised a built‑in `TypeError` for the input `['1']`; the new fast path returns early and later code apparently accesses an attribute that was not initialised, causing a built‑in `AttributeError`. Since the two built‑in exception types are unrelated (neither subclasses the other), this change of exception type is an unintended regression.
if _SIMPLE_VERSION_INDICATORS.issuperset(version): self._release = tuple(map(int, version.split('.')))Found by: Nemotron strategy search · no baseline found it
ran onlocal Docker · image bw-pair:3f8cc97a2a8a52dc
Regression test verified passes on base, errors on head
def test_1082_p2_outcome_0():
"""Breakwater P2: base behaviour pinned (found by differential testing; label: likely-bug)."""
import pytest
from packaging.version import Version
with pytest.raises(TypeError) as excinfo:
Version(['1'])
assert type(excinfo.value) is TypeError # exact type: a subclass would be a behaviour change