@@ -66,30 +66,34 @@ jobs:
6666 fi
6767
6868 python - <<'PY'
69- import os
70- import sys
71- import urllib.request
69+ import os
70+ import sys
71+ import urllib.request
7272
73- version = os.environ['NEW_VERSION']
74- keywords = [kw.strip().lower() for kw in os.environ.get('SECURITY_KEYWORDS', '').split(',') if kw.strip()]
75- if not keywords :
76- sys.exit(0)
73+ version = os.environ['NEW_VERSION']
74+ keywords = [
75+ kw.strip().lower()
76+ for kw in os.environ.get('SECURITY_KEYWORDS', '').split(',')
77+ if kw.strip()
78+ ]
79+ if not keywords:
80+ sys.exit(0)
7781
78- slug = 'python-' + version.replace('.', '')
79- url = f'https://www.python.org/downloads/release/{slug}/'
80- print(f'Fetching release notes from {url}')
81- try :
82- with urllib.request.urlopen(url, timeout=30) as response :
83- body = response.read().decode('utf-8', errors='replace').lower()
84- except Exception as exc : # noqa: BLE001
85- print(f'Failed to fetch release notes : {exc}')
86- sys.exit(1)
82+ slug = 'python-' + version.replace('.', '')
83+ url = f'https://www.python.org/downloads/release/{slug}/'
84+ print(f'Fetching release notes from {url}')
85+ try:
86+ with urllib.request.urlopen(url, timeout=30) as response:
87+ body = response.read().decode('utf-8', errors='replace').lower()
88+ except Exception as exc: # noqa: BLE001
89+ print(f'Failed to fetch release notes: {exc}')
90+ sys.exit(1)
8791
88- if any(keyword in body for keyword in keywords) :
89- print('Security keyword detected in release notes.')
90- else :
91- print('No security keywords found; aborting update.')
92- sys.exit(1)
92+ if any(keyword in body for keyword in keywords):
93+ print('Security keyword detected in release notes.')
94+ else:
95+ print('No security keywords found; aborting update.')
96+ sys.exit(1)
9397PY
9498
9599 - name : Apply CPython patch update
0 commit comments