FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pre-commit/pre_commit/request.py at v5 · pre-commit/pre-commit · GitHub
pre-commit
pre-commit
Repository navigation
Code
Issues
17
(17)
Pull requests
8
(8)
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
pre-commit
/
pre_commit
/
request.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
16 lines (12 loc) · 392 Bytes
Breadcrumbs
pre-commit
/
pre_commit
/
request.py
Copy path
File metadata and controls
16 lines (12 loc) · 392 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from
__future__
import
annotations
import
sys
import
urllib
.
request
from
typing
import
IO
from
pre_commit
.
constants
import
VERSION
def
fetch
(
url
:
str
)
->
IO
[
bytes
]:
pyver
=
'.'
.
join
(
str
(
v
)
for
v
in
sys
.
version_info
[:
3
])
req
=
urllib
.
request
.
Request
(
url
,
headers
=
{
'User-Agent'
:
f'pre-commit/
{
VERSION
}
python/
{
pyver
}
'
},
)
return
urllib
.
request
.
urlopen
(
req
)
Back
|
FazBrowse Home
|
New Git URL