Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
f63ea3d1
Kaydet (Commit)
f63ea3d1
authored
Nis 01, 2014
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge 3.4
üst
bec07d09
5dd3caed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
request.py
Lib/urllib/request.py
+2
-5
No files found.
Lib/urllib/request.py
Dosyayı görüntüle @
f63ea3d1
...
@@ -511,9 +511,6 @@ def build_opener(*handlers):
...
@@ -511,9 +511,6 @@ def build_opener(*handlers):
If any of the handlers passed as arguments are subclasses of the
If any of the handlers passed as arguments are subclasses of the
default handlers, the default handlers will not be used.
default handlers, the default handlers will not be used.
"""
"""
def
isclass
(
obj
):
return
isinstance
(
obj
,
type
)
or
hasattr
(
obj
,
"__bases__"
)
opener
=
OpenerDirector
()
opener
=
OpenerDirector
()
default_classes
=
[
ProxyHandler
,
UnknownHandler
,
HTTPHandler
,
default_classes
=
[
ProxyHandler
,
UnknownHandler
,
HTTPHandler
,
HTTPDefaultErrorHandler
,
HTTPRedirectHandler
,
HTTPDefaultErrorHandler
,
HTTPRedirectHandler
,
...
@@ -524,7 +521,7 @@ def build_opener(*handlers):
...
@@ -524,7 +521,7 @@ def build_opener(*handlers):
skip
=
set
()
skip
=
set
()
for
klass
in
default_classes
:
for
klass
in
default_classes
:
for
check
in
handlers
:
for
check
in
handlers
:
if
i
sclass
(
check
):
if
i
nstance
(
check
,
type
):
if
issubclass
(
check
,
klass
):
if
issubclass
(
check
,
klass
):
skip
.
add
(
klass
)
skip
.
add
(
klass
)
elif
isinstance
(
check
,
klass
):
elif
isinstance
(
check
,
klass
):
...
@@ -536,7 +533,7 @@ def build_opener(*handlers):
...
@@ -536,7 +533,7 @@ def build_opener(*handlers):
opener
.
add_handler
(
klass
())
opener
.
add_handler
(
klass
())
for
h
in
handlers
:
for
h
in
handlers
:
if
is
class
(
h
):
if
is
instance
(
h
,
type
):
h
=
h
()
h
=
h
()
opener
.
add_handler
(
h
)
opener
.
add_handler
(
h
)
return
opener
return
opener
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment