Staging
v0.5.1
https://github.com/python/cpython
Revision 7d2ff884eeb636fcd30ebd2f9886c4b46e8545bc authored by Christian Heimes on 30 November 2007, 14:35:04 UTC, committed by Christian Heimes on 30 November 2007, 14:35:04 UTC
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r59228 | amaury.forgeotdarc | 2007-11-29 21:24:36 +0100 (Thu, 29 Nov 2007) | 4 lines

  vc2008: Move python.vcproj first in the solution file, so that
  it becomes the default startup project when opening the file
  for the first time.
........
  r59230 | georg.brandl | 2007-11-30 00:00:03 +0100 (Fri, 30 Nov 2007) | 3 lines

  Add more examples to the wsgiref docs.
  From GHOP by Josip Dzolonga.
........
  r59231 | amaury.forgeotdarc | 2007-11-30 00:35:25 +0100 (Fri, 30 Nov 2007) | 7 lines

  Issue #1402: PyInterpreterState_Clear() may still invoke user code
  (in deallocation of running threads, for example), so the PyGILState_Release()
  function must still be functional.
  On the other hand, _PyGILState_Fini() only frees memory, and can be called later.

  Backport candidate, but only after some experts comment on it.
........
1 parent 2e510fb
Raw File
Tip revision: 7d2ff884eeb636fcd30ebd2f9886c4b46e8545bc authored by Christian Heimes on 30 November 2007, 14:35:04 UTC
Merged revisions 59226-59233 via svnmerge from
Tip revision: 7d2ff88
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