Skip to content

Commit d6eeb29

Browse files
Raise deprecation warning for Python 3.9 (#4226)
1 parent 1684ef2 commit d6eeb29

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

trl/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,26 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import sys
16+
import warnings
1517
from importlib.metadata import PackageNotFoundError, version
1618
from typing import TYPE_CHECKING
1719

1820
from .import_utils import _LazyModule
1921

2022

23+
if sys.version_info[:2] == (3, 9):
24+
warnings.warn(
25+
(
26+
"Support for Python 3.9 will be dropped in the next release "
27+
"(after its end-of-life on October 31, 2025). "
28+
"Please upgrade to Python 3.10 or newer."
29+
),
30+
category=FutureWarning,
31+
stacklevel=2,
32+
)
33+
34+
2135
try:
2236
__version__ = version("trl")
2337
except PackageNotFoundError:

0 commit comments

Comments
 (0)