Fix bug with PIPEing in Python 2.x