Restricted a workaround for a bug in Python to the affected versions.