Two methods for loading jobs I am wondering which method code is more "Pythonic":

def load_job(self, identifier, job_name):
    i = 5
    ex = None
    while i:
        try:
            for ep in iter_entry_points(group='core.account', name=identifier):
                self.modules[identifier] = ep
            # load_entry_point(ep.dist, 'core.account', ep.name)
            # The following is the same
            loaded = ep.load()
            job = getattr(loaded, job_name)
            return job
        except ImportError as e:
            ex = e
            i -= 1
            time.sleep(2)
            continue

    raise ex


Or 

def load_job(self, identifier, job_name):

    i = 5
    job = None
    ex = None
    while i:
        try:
            for ep in iter_entry_points(group='core.account', name=identifier):
                self.modules[identifier] = ep
                # load_entry_point(ep.dist, 'core.account', ep.name)
                # The following is the same
                loaded = ep.load()
                self.info("Loaded %s", ep.module_name)
                job = getattr(loaded, job_name)

            break
        except ImportError as er:
            ex = er
            i -= 1
            time.sleep(2)

    if job:
        return job
    else:
        raise ex


While the later is a bit longer, I feel it's easier to read. My main concern is whether I should return or break from within the while loop.
There are three things wrong with the while loop.


You are looping over a fixed number of times. The only other way to leave the loop is a return statement. This is exactly what a for loop is for. A while loop is used when the number of times the loop needs to execute is not known ahead of time. You should use the right tool for the job.
Don't use the truth value of a value when you can very easily explicitly state what you want the break condition to be. There are two advantages to using i &gt; 0 is better than what you have. First, it is much easier for the reader. What you have forces the reader to think about what i is, how it might be equivalent to False, and how the loop has to manipulate i to reach that condition. Secondly, you can accidentally cause an infinite loop if you are not properly manipulating i. If you accidentally double decrement i when it is equal to 1, then while clause will evaluate to True when it checks -1. This will not happen when you are explicit about when you want the looping to continue.
In the first example, the last line of the loop is continue. This serves no purpose. There is no code that would be executed otherwise if the continue was omitted. Since it is the last line, the next thing that would happen would be to evaluate the while clause. That is the same thing a continue will trigger.


Edit:

With respect to the actual question, I think returning is fine. The seconds example is an attempt to follow the single return pattern. However, the first implementation still only has one return statement. The only other way to exit the method is by having an exception raised. The try block is the main body of the method. Everything else is the retry functionality.