Skip to content

Commit

Permalink
Let requests close the file
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Jun 5, 2018
1 parent d5c4625 commit dd1a5ef
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions support/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,11 @@ def release(args):
id = r.json()['id']
uploads_url = 'https://uploads.github.com/repos/fmtlib/fmt/releases'
package = 'fmt-{}.zip'.format(version)
with open('build/fmt/' + package, 'rb') as f:
r = requests.post(
'{}/{}/assets?name={}'.format(uploads_url, id, package),
params=params, files={package: f})
if r.status_code != 201:
raise Exception('Failed to upload an asset ' + str(r))
r = requests.post(
'{}/{}/assets?name={}'.format(uploads_url, id, package),
params=params, files={package: open('build/fmt/' + package, 'rb')})
if r.status_code != 201:
raise Exception('Failed to upload an asset ' + str(r))


if __name__ == '__main__':
Expand Down

0 comments on commit dd1a5ef

Please sign in to comment.