Sync python.el with upstream

Upstream commit: 3a8de8db2994a5b98946a2edc7a757ebc20da74c