Staging
v0.5.1
Revision b0c29161a28d79f87741891b376cecf05287699f authored by Amaury Forgeot d'Arc on 22 November 2008, 22:18:04 UTC, committed by Amaury Forgeot d'Arc on 22 November 2008, 22:18:04 UTC
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.
........
1 parent ac1f9b1
Raw File
field3.py
# An absurd workaround for the lack of arithmetic in MS's resource compiler.
# After building Python, run this, then paste the output into the appropriate
# part of PC\python_nt.rc.
# Example output:
#
# * For 2.3a0,
# * PY_MICRO_VERSION = 0
# * PY_RELEASE_LEVEL = 'alpha' = 0xA
# * PY_RELEASE_SERIAL = 1
# *
# * and 0*1000 + 10*10 + 1 = 101.
# */
# #define FIELD3 101

import sys

major, minor, micro, level, serial = sys.version_info
levelnum = {'alpha': 0xA,
            'beta': 0xB,
            'candidate': 0xC,
            'final': 0xF,
           }[level]
string = sys.version.split()[0] # like '2.3a0'

print(" * For %s," % string)
print(" * PY_MICRO_VERSION = %d" % micro)
print(" * PY_RELEASE_LEVEL = %r = %s" % (level, hex(levelnum)))
print(" * PY_RELEASE_SERIAL = %d" % serial)
print(" *")

field3 = micro * 1000 + levelnum * 10 + serial

print(" * and %d*1000 + %d*10 + %d = %d" % (micro, levelnum, serial, field3))
print(" */")
print("#define FIELD3", field3)
back to top