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.

(cherry picked from commit c80e5b259fd0cf731d1de609b7529d9ede936323)
This commit is contained in:
Dan Albert 2023-05-25 21:39:07 -07:00
parent 7fea15ee07
commit d5c335c698

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