[3.11] gh-99016: Make build scripts compatible with Python 3.8 (GH-99017). (GH-99693)

(cherry picked from commit f520d720f667c87f7b70ed86ea58d73892d6b969)
2 files changed