Merge lp:~mvo/software-center/lp970342 into lp:software-center

Proposed by Michael Vogt
Status: Merged
Merged at revision: 2961
Proposed branch: lp:~mvo/software-center/lp970342
Merge into: lp:software-center
Diff against target: 17 lines (+6/-1)
1 file modified
utils/piston-helpers/piston_generic_helper.py (+6/-1)
To merge this branch: bzr merge lp:~mvo/software-center/lp970342
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Review via email: mp+101510@code.launchpad.net

Description of the change

Do not crash if the parent goes away (and therefore the pipe) and the token can not be obtained. Fixes LP: #970342

To post a comment you must log in.
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Looks exceedingly reasonable! :) Thank you, mvo!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'utils/piston-helpers/piston_generic_helper.py'
2--- utils/piston-helpers/piston_generic_helper.py 2012-03-28 12:36:26 +0000
3+++ utils/piston-helpers/piston_generic_helper.py 2012-04-11 08:43:28 +0000
4@@ -192,7 +192,12 @@
5 token = helper.get_oauth_token_and_verify_sync()
6 # if we don't have a token, error here
7 if not token:
8- sys.stderr.write("ERROR: can not obtain a oauth token\n")
9+ # it may happen that the parent is closed already so the pipe
10+ # is gone, that is ok as we exit anyway
11+ try:
12+ sys.stderr.write("ERROR: can not obtain a oauth token\n")
13+ except IOError:
14+ pass
15 sys.exit(1)
16
17 auth = piston_mini_client.auth.OAuthAuthorizer(

Subscribers

People subscribed via source and target branches