Modernize pythonrc.py, courtesy of mitsuhiko