Merge lp:~mwhudson/ssh-import-id/lp-1770302 into lp:ssh-import-id

Proposed by Michael Hudson-Doyle
Status: Merged
Merge reported by: Scott Moser
Merged at revision: not available
Proposed branch: lp:~mwhudson/ssh-import-id/lp-1770302
Merge into: lp:ssh-import-id
Diff against target: 21 lines (+3/-3)
1 file modified
ssh_import_id/__init__.py (+3/-3)
To merge this branch: bzr merge lp:~mwhudson/ssh-import-id/lp-1770302
Reviewer Review Type Date Requested Status
ssh-import-id Pending
Review via email: mp+345333@code.launchpad.net

Description of the change

exit with sys.exit() in fetch_keys_gh to ensure error messages get flushed

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

This seems sane... I'm looking to move to git, so i'd like to hold off on this rigth now, but the idea is good.

Revision history for this message
Scott Moser (smoser) wrote :

merged this in git.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ssh_import_id/__init__.py'
2--- ssh_import_id/__init__.py 2017-07-11 20:51:44 +0000
3+++ ssh_import_id/__init__.py 2018-05-10 03:37:48 +0000
4@@ -302,14 +302,14 @@
5 data = json.loads(text)
6 if resp.status_code == 404:
7 print('Username "%s" not found at GitHub API' % ghid)
8- os._exit(1)
9+ sys.exit(1)
10 if x_ratelimit_remaining in resp.headers and int(resp.headers[x_ratelimit_remaining]) == 0:
11 print('GitHub REST API rate-limited this IP address. See %s' % help_url)
12- os._exit(1)
13+ sys.exit(1)
14 for keyobj in data:
15 keys += "%s %s@github/%s\n" % (keyobj['key'], ghid, keyobj['id'])
16 except (Exception,):
17 e = sys.exc_info()[1]
18 sys.stderr.write("ERROR: %s\n" % (str(e)))
19- os._exit(1)
20+ sys.exit(1)
21 return keys

Subscribers

People subscribed via source and target branches