hussein-awala commented on code in PR #37575:
URL: https://github.com/apache/airflow/pull/37575#discussion_r1496687314


##########
airflow/__init__.py:
##########
@@ -91,6 +84,16 @@ def __getattr__(name: str):
     # PEP-562: Lazy loaded attributes on python modules
     module_path, attr_name, deprecated = __lazy_imports.get(name, ("", "", 
False))
     if not module_path:
+        if name.startswith("PY3") and (py_minor := name[3:]) in ("6", "7", 
"8", "9", "10", "11", "12"):
+            import warnings
+
+            warnings.warn(
+                f"Python version constraint {name!r} is deprecated and will be 
removed in the future. "
+                f"Please get version info from the 'sys.version_info'.",
+                DeprecationWarning,
+            )
+            return sys.version_info >= (3, int(py_minor))

Review Comment:
   Nice!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to