PR#1958: fix potentially undeclared variable error
Merges #1958 https://pagure.io/koji/pull-request/1958 Fixes: #1957 https://pagure.io/koji/issue/1957 unreferenced variable
This commit is contained in:
commit
73df118b03
2 changed files with 2 additions and 2 deletions
|
|
@ -1676,8 +1676,8 @@ def openRemoteFile(relpath, topurl=None, topdir=None, tempdir=None):
|
|||
if topurl:
|
||||
url = "%s/%s" % (topurl, relpath)
|
||||
fo = tempfile.TemporaryFile(dir=tempdir)
|
||||
resp = requests.get(url, stream=True)
|
||||
try:
|
||||
resp = requests.get(url, stream=True)
|
||||
for chunk in resp.iter_content(chunk_size=8192):
|
||||
fo.write(chunk)
|
||||
finally:
|
||||
|
|
|
|||
|
|
@ -478,8 +478,8 @@ class BaseTaskHandler(object):
|
|||
return fn
|
||||
self.logger.debug("Downloading %s", relpath)
|
||||
url = "%s/%s" % (self.options.topurl, relpath)
|
||||
resp = requests.get(url, stream=True)
|
||||
try:
|
||||
resp = requests.get(url, stream=True)
|
||||
if not os.path.exists(os.path.dirname(fn)):
|
||||
os.makedirs(os.path.dirname(fn))
|
||||
with open(fn, 'wb') as fdst:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue