lang/python310: fix stage with DEBUG option ON
MFH: 2024Q3 (cherry picked from commit 6b2a7f9dde98dddbf7f7b6e79b280e49221f0788)