Code review comment for lp:~leonardr/launchpadlib/trusted-workflow-tests-2

Revision history for this message
Leonard Richardson (leonardr) wrote :

> > + try:
> > + self()
> > + except TokenAuthorizationException, e:
> > + print str(e)
> > + self.error_code = -1
> > + return self.pressEnterToExit()
>
> The above call is redundant because of the one below, no?
>
> > + return self.pressEnterToExit()

Yes, I've removed the redundant call.

> > + def pressEnterToExit(self):
> > + """Make the user hit enter, and then exit with an error code."""
> > + prompt = '\nPress enter to go back to "%s". ' % self.consumer_name
> > + self.input_method(prompt)
> > + self.exit_with(self.error_code)
> > + return self.error_code
>
> Since exit_with() will call sys.exit(), there's no reason to return
> anything here, is there?

The default implementation of exit_with() calls sys.exit(), but my testing version returned the error code. However I was just ignoring the error code in my tests, so it's not necessary.

« Back to merge proposal