Raise deprecation warning for Python 3.9 (#4226)

This commit is contained in:
Albert Villanova del Moral
2025-10-13 11:06:09 +02:00
committed by GitHub
parent 1684ef279a
commit d6eeb290d9

View File

@ -12,12 +12,26 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import warnings
from importlib.metadata import PackageNotFoundError, version
from typing import TYPE_CHECKING
from .import_utils import _LazyModule
if sys.version_info[:2] == (3, 9):
warnings.warn(
(
"Support for Python 3.9 will be dropped in the next release "
"(after its end-of-life on October 31, 2025). "
"Please upgrade to Python 3.10 or newer."
),
category=FutureWarning,
stacklevel=2,
)
try:
__version__ = version("trl")
except PackageNotFoundError: