Skip to content

Commit 5c608aa

Browse files
authored
SG-39039 Add deprecation warnings for Python <3.9 (#1024)
Issue a deprecation warning if using Python version <3.9
1 parent ed6c133 commit 5c608aa

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

python/tank/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,23 @@
2929
# configuration has its python sgtk/tank module imported directly, it will associate
3030
# itself with the primary config rather than with the config where the code is located.
3131

32+
import inspect
3233
import os
3334
import sys
3435
import uuid
35-
import inspect
36+
import warnings
3637

3738
if sys.version_info < (3, 7):
3839
raise Exception("This module requires Python version 3.7 or higher.")
40+
elif sys.version_info < (3, 9):
41+
warnings.warn(
42+
"Python versions older than 3.9 are no longer supported since 2025-03 "
43+
"and compatibility will be removed at any time after 2026-01. "
44+
"Please update to Python 3.9 or a newer supported version.",
45+
DeprecationWarning,
46+
stacklevel=2
47+
)
48+
3949

4050
def __fix_tank_vendor():
4151
# Older versions of Flow Production Tracking left copies of tank_vendor in sys.modules,

0 commit comments

Comments
 (0)