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
8ec57540
Kaydet (Commit)
8ec57540
authored
Agu 24, 2007
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
uuid creation is now threadsafe, backport from py3k rev. 57375.
üst
1042a4d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
uuid.py
Lib/uuid.py
+4
-1
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/uuid.py
Dosyayı görüntüle @
8ec57540
...
@@ -393,7 +393,6 @@ def _netbios_getnode():
...
@@ -393,7 +393,6 @@ def _netbios_getnode():
_uuid_generate_random
=
_uuid_generate_time
=
_UuidCreate
=
None
_uuid_generate_random
=
_uuid_generate_time
=
_UuidCreate
=
None
try
:
try
:
import
ctypes
,
ctypes
.
util
import
ctypes
,
ctypes
.
util
_buffer
=
ctypes
.
create_string_buffer
(
16
)
# The uuid_generate_* routines are provided by libuuid on at least
# The uuid_generate_* routines are provided by libuuid on at least
# Linux and FreeBSD, and provided by libc on Mac OS X.
# Linux and FreeBSD, and provided by libc on Mac OS X.
...
@@ -426,11 +425,13 @@ except:
...
@@ -426,11 +425,13 @@ except:
def
_unixdll_getnode
():
def
_unixdll_getnode
():
"""Get the hardware address on Unix using ctypes."""
"""Get the hardware address on Unix using ctypes."""
_buffer
=
ctypes
.
create_string_buffer
(
16
)
_uuid_generate_time
(
_buffer
)
_uuid_generate_time
(
_buffer
)
return
UUID
(
bytes
=
_buffer
.
raw
)
.
node
return
UUID
(
bytes
=
_buffer
.
raw
)
.
node
def
_windll_getnode
():
def
_windll_getnode
():
"""Get the hardware address on Windows using ctypes."""
"""Get the hardware address on Windows using ctypes."""
_buffer
=
ctypes
.
create_string_buffer
(
16
)
if
_UuidCreate
(
_buffer
)
==
0
:
if
_UuidCreate
(
_buffer
)
==
0
:
return
UUID
(
bytes
=
_buffer
.
raw
)
.
node
return
UUID
(
bytes
=
_buffer
.
raw
)
.
node
...
@@ -478,6 +479,7 @@ def uuid1(node=None, clock_seq=None):
...
@@ -478,6 +479,7 @@ def uuid1(node=None, clock_seq=None):
# When the system provides a version-1 UUID generator, use it (but don't
# 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).
# 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
:
if
_uuid_generate_time
and
node
is
clock_seq
is
None
:
_uuid_generate_time
(
_buffer
)
_uuid_generate_time
(
_buffer
)
return
UUID
(
bytes
=
_buffer
.
raw
)
return
UUID
(
bytes
=
_buffer
.
raw
)
...
@@ -514,6 +516,7 @@ def uuid4():
...
@@ -514,6 +516,7 @@ def uuid4():
"""Generate a random UUID."""
"""Generate a random UUID."""
# When the system provides a version-4 UUID generator, use it.
# When the system provides a version-4 UUID generator, use it.
_buffer
=
ctypes
.
create_string_buffer
(
16
)
if
_uuid_generate_random
:
if
_uuid_generate_random
:
_uuid_generate_random
(
_buffer
)
_uuid_generate_random
(
_buffer
)
return
UUID
(
bytes
=
_buffer
.
raw
)
return
UUID
(
bytes
=
_buffer
.
raw
)
...
...
Misc/NEWS
Dosyayı görüntüle @
8ec57540
...
@@ -240,6 +240,8 @@ Core and builtins
...
@@ -240,6 +240,8 @@ Core and builtins
Library
Library
-------
-------
- uuid creation is now threadsafe.
- EUC-KR codec now handles the cheot-ga-keut composed make-up hangul
- EUC-KR codec now handles the cheot-ga-keut composed make-up hangul
syllables.
syllables.
...
...
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