fix an issue under pypy > 2.0 where attached_id will be a long