Revert "Prevent Python process shell buffer to pop twice."

This reverts commit 4256626a7ac486446f4dea9c12df3057053825a7.