I think we can make a helper function for this, and [reuse it in `job.py`](https://github.com/nvie/rq/blob/20f4bb5138ec30e2da50c3e83cbad40e0e8a3d6c/rq/job.py#L154-L156), too.