mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-04-12 10:51:08 +00:00
sponsor-patch: fix bugs from py3 migration
This commit is contained in:
parent
a75fb35fc8
commit
bc24ef23de
@ -82,7 +82,7 @@ def input_number(question, min_number, max_number, default=None):
|
||||
else:
|
||||
question += "? "
|
||||
selected = None
|
||||
while selected < min_number or selected > max_number:
|
||||
while not selected or selected < min_number or selected > max_number:
|
||||
try:
|
||||
selected = input(question).strip()
|
||||
except (EOFError, KeyboardInterrupt):
|
||||
|
@ -74,7 +74,7 @@ class BugTask(object):
|
||||
if url.endswith(".dsc"):
|
||||
response, data = httplib2.Http().request(url)
|
||||
assert response.status == 200
|
||||
with open(filename, 'w') as f:
|
||||
with open(filename, 'wb') as f:
|
||||
f.write(data)
|
||||
|
||||
dsc_file = os.path.join(os.getcwd(), filename)
|
||||
|
@ -68,7 +68,7 @@ class Patch(object):
|
||||
def download(self):
|
||||
"""Downloads the patch from Launchpad."""
|
||||
Logger.debug("Downloading %s." % (self._patch_file))
|
||||
patch_f = open(self._patch_file, "w")
|
||||
patch_f = open(self._patch_file, "wb")
|
||||
patch_f.write(self._patch.data.open().read())
|
||||
patch_f.close()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user