I recently installed Python 2.7.3 on a CentOS machine by compiling from source. Python 2.7.3 is installed at /opt/python2.7 and when I installed it I just changed /usr/bin/p
I recommend, instead, updating the path in the associated script(s) (such as /usr/bin/yum) to point at your previous Python as the interpreter.
Ideally, you want to upgrade yum and its associated scripts so that they are supported by the default Python installed.
If that is not possible, the above is entirely workable and tested.
Change:
#!/usr/bin/python
to whatever the path is of your old version until you can make the above yum improvement.
Cases where you couldn't do the above are if you have an isolated machine, don't have the time to upgrade rpm manually or can't connect temporarily or permanently to a standard yum repository.