[Python-checkins] r67319 - in python/branches/release26-maint: Lib/uuid.py Misc/NEWS

amaury.forgeotdarc python-checkins at python.org
Fri Nov 21 23:08:14 CET 2008


Author: amaury.forgeotdarc
Date: Fri Nov 21 23:08:14 2008
New Revision: 67319

Log:
Merged revisions 67318 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r67318 | amaury.forgeotdarc | 2008-11-21 23:05:48 +0100 (ven., 21 nov. 2008) | 4 lines
  
  #4363: Let uuid.uuid1() and uuid.uuid4() run even if the ctypes module is not present.
  
  Will backport to 2.6
........


Modified:
   python/branches/release26-maint/   (props changed)
   python/branches/release26-maint/Lib/uuid.py
   python/branches/release26-maint/Misc/NEWS

Modified: python/branches/release26-maint/Lib/uuid.py
==============================================================================
--- python/branches/release26-maint/Lib/uuid.py	(original)
+++ python/branches/release26-maint/Lib/uuid.py	Fri Nov 21 23:08:14 2008
@@ -479,8 +479,8 @@
 
     # 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 @@
     """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)
 

Modified: python/branches/release26-maint/Misc/NEWS
==============================================================================
--- python/branches/release26-maint/Misc/NEWS	(original)
+++ python/branches/release26-maint/Misc/NEWS	Fri Nov 21 23:08:14 2008
@@ -45,6 +45,9 @@
 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__.
 
 - Issue #3774: Fixed an error when create a Tkinter menu item without command


More information about the Python-checkins mailing list