In this case, you should write your own answer.
In my mind, because Python 2.x is going EOL, it doesn't make sense to support any documentation related to Python 2.x since that's not what people are going to be searching for.
The tools exist to write a sufficiently acceptable answer for Python 3.x, and I would encourage you to do so in this case.
It's a crap-shoot when editing code since many will interpret that as you changing the meaning (remember - the people reviewing your edit may not know the language), so it's better to strive for the cleaner option.