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
40df67f7
Kaydet (Commit)
40df67f7
authored
Tem 12, 2007
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #1752270, #1750931: complain if urllib2 add_handler called
without handler. (backport from rev. 56293)
üst
ad4b263b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
test_urllib2.py
Lib/test/test_urllib2.py
+6
-0
urllib2.py
Lib/urllib2.py
+4
-0
No files found.
Lib/test/test_urllib2.py
Dosyayı görüntüle @
40df67f7
...
...
@@ -381,6 +381,12 @@ class MockPasswordManager:
class
OpenerDirectorTests
(
unittest
.
TestCase
):
def
test_add_non_handler
(
self
):
class
NonHandler
(
object
):
pass
self
.
assertRaises
(
TypeError
,
OpenerDirector
()
.
add_handler
,
NonHandler
())
def
test_badly_named_methods
(
self
):
# test work-around for three methods that accidentally follow the
# naming conventions for handler methods
...
...
Lib/urllib2.py
Dosyayı görüntüle @
40df67f7
...
...
@@ -298,6 +298,10 @@ class OpenerDirector:
self
.
process_request
=
{}
def
add_handler
(
self
,
handler
):
if
not
hasattr
(
handler
,
"add_parent"
):
raise
TypeError
(
"expected BaseHandler instance, got
%
r"
%
type
(
handler
))
added
=
False
for
meth
in
dir
(
handler
):
if
meth
in
[
"redirect_request"
,
"do_open"
,
"proxy_open"
]:
...
...
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