Allow save compat to exist for two versions.

We want to clean up eventually, but allowing it to exist in both develop
and the release branch makes cherry picks easier.
This commit is contained in:
Dan Albert 2023-05-25 21:39:07 -07:00
parent 64e2213f28
commit c80e5b259f

View File

@ -41,7 +41,8 @@ def has_save_compat_for(
"""
def decorator(func: Callable[..., ReturnT]) -> Callable[..., ReturnT]:
if major != MAJOR_VERSION:
# Allow current and previous version to ease cherry-picking.
if major not in {MAJOR_VERSION - 1, MAJOR_VERSION}:
raise DeprecatedSaveCompatError(func.__name__)
return func