lang/python311: Fix packaging when DEBUG option is on
(cherry picked from commit 2130bf710ed7d1ed76ddb08760fdc6b61db1fb91)