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
37410aa0
Kaydet (Commit)
37410aa0
authored
Agu 24, 2007
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make uuid.py thread-safe. Fix by Yuri Ginsburg.
üst
fd53fd62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
uuid.py
Lib/uuid.py
+4
-1
No files found.
Lib/uuid.py
Dosyayı görüntüle @
37410aa0
...
...
@@ -414,7 +414,6 @@ def _netbios_getnode():
_uuid_generate_random
=
_uuid_generate_time
=
_UuidCreate
=
None
try
:
import
ctypes
,
ctypes
.
util
_buffer
=
ctypes
.
create_string_buffer
(
16
)
# The uuid_generate_* routines are provided by libuuid on at least
# Linux and FreeBSD, and provided by libc on Mac OS X.
...
...
@@ -447,11 +446,13 @@ except:
def
_unixdll_getnode
():
"""Get the hardware address on Unix using ctypes."""
_buffer
=
ctypes
.
create_string_buffer
(
16
)
_uuid_generate_time
(
_buffer
)
return
UUID
(
bytes
=
bytes_
(
_buffer
.
raw
))
.
node
def
_windll_getnode
():
"""Get the hardware address on Windows using ctypes."""
_buffer
=
ctypes
.
create_string_buffer
(
16
)
if
_UuidCreate
(
_buffer
)
==
0
:
return
UUID
(
bytes
=
bytes_
(
_buffer
.
raw
))
.
node
...
...
@@ -499,6 +500,7 @@ def uuid1(node=None, clock_seq=None):
# When the system provides a version-1 UUID generator, use it (but don't
# use UuidCreate here because its UUIDs don't conform to RFC 4122).
_buffer
=
ctypes
.
create_string_buffer
(
16
)
if
_uuid_generate_time
and
node
is
clock_seq
is
None
:
_uuid_generate_time
(
_buffer
)
return
UUID
(
bytes
=
bytes_
(
_buffer
.
raw
))
...
...
@@ -535,6 +537,7 @@ def uuid4():
"""Generate a random UUID."""
# When the system provides a version-4 UUID generator, use it.
_buffer
=
ctypes
.
create_string_buffer
(
16
)
if
_uuid_generate_random
:
_uuid_generate_random
(
_buffer
)
return
UUID
(
bytes
=
bytes_
(
_buffer
.
raw
))
...
...
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