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
ac4aa7b6
Kaydet (Commit)
ac4aa7b6
authored
Kas 30, 2014
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #22902: The "ip" command is now used on Linux to determine MAC address
in uuid.getnode(). Pach by Bruno Cauet.
üst
16e802f4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
2 deletions
+19
-2
test_uuid.py
Lib/test/test_uuid.py
+6
-0
uuid.py
Lib/uuid.py
+9
-2
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_uuid.py
Dosyayı görüntüle @
ac4aa7b6
...
@@ -320,6 +320,12 @@ class TestUUID(unittest.TestCase):
...
@@ -320,6 +320,12 @@ class TestUUID(unittest.TestCase):
if
node
is
not
None
:
if
node
is
not
None
:
self
.
check_node
(
node
,
'ifconfig'
)
self
.
check_node
(
node
,
'ifconfig'
)
@unittest.skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
def
test_ip_getnode
(
self
):
node
=
uuid
.
_ip_getnode
()
if
node
is
not
None
:
self
.
check_node
(
node
,
'ip'
)
@unittest.skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
@unittest.skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
def
test_arp_getnode
(
self
):
def
test_arp_getnode
(
self
):
node
=
uuid
.
_arp_getnode
()
node
=
uuid
.
_arp_getnode
()
...
...
Lib/uuid.py
Dosyayı görüntüle @
ac4aa7b6
...
@@ -356,6 +356,13 @@ def _ifconfig_getnode():
...
@@ -356,6 +356,13 @@ def _ifconfig_getnode():
if
mac
:
if
mac
:
return
mac
return
mac
def
_ip_getnode
():
"""Get the hardware address on Unix by running ip."""
# This works on Linux with iproute2.
mac
=
_find_mac
(
'ip'
,
'link list'
,
[
b
'link/ether'
],
lambda
i
:
i
+
1
)
if
mac
:
return
mac
def
_arp_getnode
():
def
_arp_getnode
():
"""Get the hardware address on Unix by running arp."""
"""Get the hardware address on Unix by running arp."""
import
os
,
socket
import
os
,
socket
...
@@ -538,8 +545,8 @@ def getnode():
...
@@ -538,8 +545,8 @@ def getnode():
if
sys
.
platform
==
'win32'
:
if
sys
.
platform
==
'win32'
:
getters
=
[
_windll_getnode
,
_netbios_getnode
,
_ipconfig_getnode
]
getters
=
[
_windll_getnode
,
_netbios_getnode
,
_ipconfig_getnode
]
else
:
else
:
getters
=
[
_unixdll_getnode
,
_ifconfig_getnode
,
_
ar
p_getnode
,
getters
=
[
_unixdll_getnode
,
_ifconfig_getnode
,
_
i
p_getnode
,
_lanscan_getnode
,
_netstat_getnode
]
_
arp_getnode
,
_
lanscan_getnode
,
_netstat_getnode
]
for
getter
in
getters
+
[
_random_getnode
]:
for
getter
in
getters
+
[
_random_getnode
]:
try
:
try
:
...
...
Misc/ACKS
Dosyayı görüntüle @
ac4aa7b6
...
@@ -217,6 +217,7 @@ Pierre Carrier
...
@@ -217,6 +217,7 @@ Pierre Carrier
Terry Carroll
Terry Carroll
Edward Catmur
Edward Catmur
Lorenzo M. Catucci
Lorenzo M. Catucci
Bruno Cauet
Donn Cave
Donn Cave
Charles Cazabon
Charles Cazabon
Jesús Cea Avión
Jesús Cea Avión
...
...
Misc/NEWS
Dosyayı görüntüle @
ac4aa7b6
...
@@ -191,6 +191,9 @@ Core and Builtins
...
@@ -191,6 +191,9 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
22902
:
The
"ip"
command
is
now
used
on
Linux
to
determine
MAC
address
in
uuid
.
getnode
().
Pach
by
Bruno
Cauet
.
-
Issue
#
22960
:
Add
a
context
argument
to
xmlrpclib
.
ServerProxy
constructor
.
-
Issue
#
22960
:
Add
a
context
argument
to
xmlrpclib
.
ServerProxy
constructor
.
-
Issue
#
22389
:
Add
contextlib
.
redirect_stderr
().
-
Issue
#
22389
:
Add
contextlib
.
redirect_stderr
().
...
...
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