Merged revisions 67295,67301-67302,67318,67330,67342-67343 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r67295 | benjamin.peterson | 2008-11-20 05:05:12 +0100 (jeu., 20 nov. 2008) | 1 line

  move useful sys.settrace information to the function's documentation from the debugger
........
  r67301 | benjamin.peterson | 2008-11-20 22:25:31 +0100 (jeu., 20 nov. 2008) | 1 line

  fix indentation and a sphinx warning
........
  r67302 | benjamin.peterson | 2008-11-20 22:44:23 +0100 (jeu., 20 nov. 2008) | 1 line

  oops! didn't mean to disable that test
........
  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
........
  r67330 | georg.brandl | 2008-11-22 09:34:14 +0100 (sam., 22 nov. 2008) | 2 lines

  #4364: fix attribute name on ctypes object.
........
  r67342 | amaury.forgeotdarc | 2008-11-22 20:39:38 +0100 (sam., 22 nov. 2008) | 3 lines

  yuvconvert.c is a part of the "sv" module, an old IRIX thing
  and certainly not useful for any Windows build.
........
  r67343 | amaury.forgeotdarc | 2008-11-22 21:01:18 +0100 (sam., 22 nov. 2008) | 5 lines

  #3996: On Windows, PyOS_CheckStack is supposed to protect the interpreter from
  stack overflow. But doing this, it always crashes when the stack is nearly full.

  Reviewed by Martin von Loewis. Will backport to 2.6.
........
diff --git a/Lib/uuid.py b/Lib/uuid.py
index eaf7c88..d50550a 100644
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -500,8 +500,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=bytes_(_buffer.raw))
 
@@ -537,8 +537,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=bytes_(_buffer.raw))