lang/python311: fix stage with DEBUG option ON
(cherry picked from commit a6e3b850c244b85bc0fe19b660833c5fe6f05a2f)