Skip to content

Commit f8c1802

Browse files
committed
add support and CI testing for Python 3.14
`URLopener` has been deprecated for a long time and is now removed. We were only using it for a version string, and that's easy to reproduce.
1 parent 94df648 commit f8c1802

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.github/workflows/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
16+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
1717
os: [ubuntu-latest, windows-latest, macOS-latest]
1818

1919
steps:

peru/resources/plugins/curl/curl_plugin.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@
1616

1717

1818
def add_user_agent_to_request(request):
19-
components = [
20-
"peru/%s" % peru.main.get_version(),
21-
urllib.request.URLopener.version
22-
]
23-
request.add_header("User-agent", " ".join(components))
19+
version = peru.main.get_version()
20+
pymajor = sys.version_info.major
21+
pyminor = sys.version_info.minor
22+
request.add_header("User-agent", f"peru/{version} Python-urllib/{pymajor}.{pyminor}")
2423
return request
2524

2625

0 commit comments

Comments
 (0)