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
5dd3caed
Kaydet (Commit)
5dd3caed
authored
Nis 01, 2014
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
simplify check, since now there are only new-style classes
üst
9d08562e
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 @
5dd3caed
...
...
@@ -511,9 +511,6 @@ def build_opener(*handlers):
If any of the handlers passed as arguments are subclasses of the
default handlers, the default handlers will not be used.
"""
def
isclass
(
obj
):
return
isinstance
(
obj
,
type
)
or
hasattr
(
obj
,
"__bases__"
)
opener
=
OpenerDirector
()
default_classes
=
[
ProxyHandler
,
UnknownHandler
,
HTTPHandler
,
HTTPDefaultErrorHandler
,
HTTPRedirectHandler
,
...
...
@@ -524,7 +521,7 @@ def build_opener(*handlers):
skip
=
set
()
for
klass
in
default_classes
:
for
check
in
handlers
:
if
i
sclass
(
check
):
if
i
nstance
(
check
,
type
):
if
issubclass
(
check
,
klass
):
skip
.
add
(
klass
)
elif
isinstance
(
check
,
klass
):
...
...
@@ -536,7 +533,7 @@ def build_opener(*handlers):
opener
.
add_handler
(
klass
())
for
h
in
handlers
:
if
is
class
(
h
):
if
is
instance
(
h
,
type
):
h
=
h
()
opener
.
add_handler
(
h
)
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