I'm now wondering if a torus shaped space object is even possible ..
More seriously though, there is as always math for this. For an object to remain torus shaped it has to resist gravity trying to pull it into a more spherical shape around the centre of mass. More info here if your curious https://astronomy.stackexchange.com/q/2092/501