summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-11-21 22:05:48 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-11-21 22:05:48 (GMT)
commitd42941751c52e4e077e3d94bef6f4a3e545444ee (patch)
tree1bf4228c0763c3b6888a50c8f4b44601b89d8c43
parent322656596abfd772b0573731a78676f4a16f2d34 (diff)
downloadcpython-d42941751c52e4e077e3d94bef6f4a3e545444ee.zip
cpython-d42941751c52e4e077e3d94bef6f4a3e545444ee.tar.gz
cpython-d42941751c52e4e077e3d94bef6f4a3e545444ee.tar.bz2
#4363: Let uuid.uuid1() and uuid.uuid4() run even if the ctypes module is not present.
Will backport to 2.6
-rw-r--r--Lib/uuid.py4
-rw-r--r--Misc/NEWS3
2 files changed, 5 insertions, 2 deletions
diff --git a/Lib/uuid.py b/Lib/uuid.py
index e1b2f4b..4840fa5 100644
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -479,8 +479,8 @@ 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:
+ _buffer = ctypes.create_string_buffer(16)
_uuid_generate_time(_buffer)
return UUID(bytes=_buffer.raw)
@@ -516,8 +516,8 @@ 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:
+ _buffer = ctypes.create_string_buffer(16)
_uuid_generate_random(_buffer)
return UUID(bytes=_buffer.raw)
diff --git a/Misc/NEWS b/Misc/NEWS
index 7e6787a..1fcf319 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -50,6 +50,9 @@ Core and Builtins
Library
-------
+- Issue #4363: The uuid.uuid1() and uuid.uuid4() functions now work even if
+ the ctypes module is not present.
+
- Issue #4116: Resolve member name conflict in ScrolledCanvas.__init__.
- httplib.HTTPConnection.putheader() now accepts an arbitrary number of values