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
=== modified file 'utils/piston-helpers/piston_generic_helper.py'
--- utils/piston-helpers/piston_generic_helper.py 2012-03-28 12:36:26 +0000
+++ utils/piston-helpers/piston_generic_helper.py 2012-04-11 08:43:28 +0000
@@ -192,7 +192,12 @@
192 token = helper.get_oauth_token_and_verify_sync()192 token = helper.get_oauth_token_and_verify_sync()
193 # if we don't have a token, error here193 # if we don't have a token, error here
194 if not token:194 if not token:
195 sys.stderr.write("ERROR: can not obtain a oauth token\n")195 # it may happen that the parent is closed already so the pipe
196 # is gone, that is ok as we exit anyway
197 try:
198 sys.stderr.write("ERROR: can not obtain a oauth token\n")
199 except IOError:
200 pass
196 sys.exit(1)201 sys.exit(1)
197202
198 auth = piston_mini_client.auth.OAuthAuthorizer(203 auth = piston_mini_client.auth.OAuthAuthorizer(

Subscribers

People subscribed via source and target branches