Yes, porting is what you are looking for here.
Porting is a non-trivial task that requires various decisions regarding your code. For example, do you want to maintain backward compatibility. There is no one universal solution for porting. The way you port depends on your specific requirements.
, Python 2 3, - wiki PortingPythonToPy3k. , , .