allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [allura] branch master updated: [#8353] test fixes
Date Fri, 20 Mar 2020 19:48:07 GMT
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/master by this push:
     new 9de2a8f  [#8353] test fixes
9de2a8f is described below

commit 9de2a8f04d95cfb578c3daf62e1a91011945d7b9
Author: Dave Brondsema <dave@brondsema.net>
AuthorDate: Fri Mar 20 15:48:01 2020 -0400

    [#8353] test fixes
---
 Allura/allura/lib/helpers.py          | 2 +-
 ForgeImporters/forgeimporters/base.py | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index 02f8294..607774e 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -1032,7 +1032,7 @@ def urlopen(url, retries=3, codes=(408, 500, 502, 503, 504), timeout=None):
                     url_string += ' => {}'.format(e.filename)
                 if timeout is None:
                     timeout = socket.getdefaulttimeout()
-                if hasattr(e, 'fp'):
+                if getattr(e, 'fp', None):
                     body = e.fp.read()
                 else:
                     body = ''
diff --git a/ForgeImporters/forgeimporters/base.py b/ForgeImporters/forgeimporters/base.py
index 1e7208d..7f2b36f 100644
--- a/ForgeImporters/forgeimporters/base.py
+++ b/ForgeImporters/forgeimporters/base.py
@@ -172,8 +172,8 @@ class ProjectExtractor(object):
     def urlopen(url, retries=3, codes=(408, 500, 502, 503, 504), timeout=120, unredirected_hdrs=None,
**kw):
         req = six.moves.urllib.request.Request(url, **kw)
         if unredirected_hdrs:
-            for k, v in unredirected_hdrs.items():
-                req.add_unredirected_header(k, v)
+            for key, val in unredirected_hdrs.items():
+                req.add_unredirected_header(key, val)
         req.add_header('User-Agent', 'Allura Data Importer (https://allura.apache.org/)')
         return h.urlopen(req, retries=retries, codes=codes, timeout=timeout)
 


Mime
View raw message