public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
* [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20220704-27-g6087edd
@ 2022-11-20 21:34 Jon TURNEY
  0 siblings, 0 replies; only message in thread
From: Jon TURNEY @ 2022-11-20 21:34 UTC (permalink / raw)
  To: cygwin-apps-cvs




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=6087edd6a7097ec102f3a15647beda0099e3ebdf

commit 6087edd6a7097ec102f3a15647beda0099e3ebdf
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Sun Nov 20 21:32:17 2022 +0000

    CI: Drop no longer available python 3.6

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=fc50fe36f4834273b0063caada2aeea6cf200672

commit fc50fe36f4834273b0063caada2aeea6cf200672
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Sun Nov 20 21:24:34 2022 +0000

    Avoid an exception when homepage: isn't a URL
    
    urllib.request.Request() throws a ValueError when the URL doesn't start
    with a scheme. e.g. is just a hostname.


Diff:
---
 .github/workflows/calm.yaml | 2 +-
 calm/fixes.py               | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/calm.yaml b/.github/workflows/calm.yaml
index 90a532a..3e65dd6 100644
--- a/.github/workflows/calm.yaml
+++ b/.github/workflows/calm.yaml
@@ -8,7 +8,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        python-version: [3.6, 3.7, 3.8, 3.9, '3.10']
+        python-version: [3.7, 3.8, 3.9, '3.10']
 
     steps:
       - uses: actions/checkout@v2
diff --git a/calm/fixes.py b/calm/fixes.py
index f147be2..1f67d13 100644
--- a/calm/fixes.py
+++ b/calm/fixes.py
@@ -98,8 +98,8 @@ class NoRedirection(urllib.request.HTTPErrorProcessor):
 def follow_redirect(homepage):
     opener = urllib.request.build_opener(NoRedirection)
     opener.addheaders = [('User-Agent', 'calm')]
-    request = urllib.request.Request(homepage, method='HEAD')
     try:
+        request = urllib.request.Request(homepage, method='HEAD')
         response = opener.open(request, timeout=60)
         if response.code in [301, 308]:
             return response.headers['Location']


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-20 21:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-20 21:34 [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20220704-27-g6087edd Jon TURNEY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).