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
28dc1186
Kaydet (Commit)
28dc1186
authored
Haz 11, 2016
tarafından
Berker Peksag
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #20508: Improve exception message of IPv{4,6}Network.__getitem__
Patch by Gareth Rees.
üst
24b102e6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
ipaddress.py
Lib/ipaddress.py
+2
-2
test_ipaddress.py
Lib/test/test_ipaddress.py
+1
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/ipaddress.py
Dosyayı görüntüle @
28dc1186
...
@@ -636,12 +636,12 @@ class _BaseNetwork(_IPAddressBase):
...
@@ -636,12 +636,12 @@ class _BaseNetwork(_IPAddressBase):
broadcast
=
int
(
self
.
broadcast_address
)
broadcast
=
int
(
self
.
broadcast_address
)
if
n
>=
0
:
if
n
>=
0
:
if
network
+
n
>
broadcast
:
if
network
+
n
>
broadcast
:
raise
IndexError
raise
IndexError
(
'address out of range'
)
return
self
.
_address_class
(
network
+
n
)
return
self
.
_address_class
(
network
+
n
)
else
:
else
:
n
+=
1
n
+=
1
if
broadcast
+
n
<
network
:
if
broadcast
+
n
<
network
:
raise
IndexError
raise
IndexError
(
'address out of range'
)
return
self
.
_address_class
(
broadcast
+
n
)
return
self
.
_address_class
(
broadcast
+
n
)
def
__lt__
(
self
,
other
):
def
__lt__
(
self
,
other
):
...
...
Lib/test/test_ipaddress.py
Dosyayı görüntüle @
28dc1186
...
@@ -1176,6 +1176,7 @@ class IpaddrUnitTest(unittest.TestCase):
...
@@ -1176,6 +1176,7 @@ class IpaddrUnitTest(unittest.TestCase):
self
.
assertEqual
(
str
(
self
.
ipv6_network
[
5
]),
self
.
assertEqual
(
str
(
self
.
ipv6_network
[
5
]),
'2001:658:22a:cafe::5'
)
'2001:658:22a:cafe::5'
)
self
.
assertRaises
(
IndexError
,
self
.
ipv6_network
.
__getitem__
,
1
<<
64
)
def
testGetitem
(
self
):
def
testGetitem
(
self
):
# http://code.google.com/p/ipaddr-py/issues/detail?id=15
# http://code.google.com/p/ipaddr-py/issues/detail?id=15
...
...
Misc/NEWS
Dosyayı görüntüle @
28dc1186
...
@@ -38,6 +38,9 @@ Core and Builtins
...
@@ -38,6 +38,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #20508: Improve exception message of IPv{4,6}Network.__getitem__.
Patch by Gareth Rees.
- Issue #21386: Implement missing IPv4Address.is_global property. It was
- Issue #21386: Implement missing IPv4Address.is_global property. It was
documented since 07a5610bae9d. Initial patch by Roger Luethi.
documented since 07a5610bae9d. Initial patch by Roger Luethi.
...
...
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