Staging
v0.5.1
https://github.com/python/cpython
Revision 4df89ed58c656580e1681904c8770536909657fc authored by Georg Brandl on 26 November 2010, 09:00:28 UTC, committed by Georg Brandl on 26 November 2010, 09:00:28 UTC
........
  r85680 | georg.brandl | 2010-10-18 09:27:55 +0200 (Mo, 18 Okt 2010) | 1 line

  Fix compiler warning about unused static function.
........
  r85681 | georg.brandl | 2010-10-18 09:30:06 +0200 (Mo, 18 Okt 2010) | 1 line

  Fix type of hash function.
........
  r85682 | georg.brandl | 2010-10-18 09:32:48 +0200 (Mo, 18 Okt 2010) | 1 line

  Remove unneeded casts to hashfunc.
........
  r85683 | georg.brandl | 2010-10-18 09:35:09 +0200 (Mo, 18 Okt 2010) | 1 line

  Remove more unneeded casts to hashfunc.
........
  r85692 | georg.brandl | 2010-10-18 14:24:53 +0200 (Mo, 18 Okt 2010) | 1 line

  Fix hash function type.
........
  r85787 | georg.brandl | 2010-10-22 08:28:01 +0200 (Fr, 22 Okt 2010) | 1 line

  #10166: rewrite self-recursion to iteration in pstats.Stats.add().  Also add a unittest and a stats test file.
........
  r85788 | georg.brandl | 2010-10-22 08:29:21 +0200 (Fr, 22 Okt 2010) | 1 line

  Make top_level attribute a set instead of a dict with None values.
........
  r85789 | georg.brandl | 2010-10-22 08:35:59 +0200 (Fr, 22 Okt 2010) | 1 line

  Refactor interesting use of try-finally.
........
  r85807 | georg.brandl | 2010-10-23 19:31:52 +0200 (Sa, 23 Okt 2010) | 1 line

  #6518: enable context manager protocol for ossaudiodev types.
........
  r85822 | georg.brandl | 2010-10-24 16:21:42 +0200 (So, 24 Okt 2010) | 1 line

  Add casts (one needed, one for consistency).
........
  r85824 | georg.brandl | 2010-10-24 17:11:22 +0200 (So, 24 Okt 2010) | 6 lines

  Add a new warning gategory, ResourceWarning, as discussed on python-dev.  It is silent by default,
  except when configured --with-pydebug.

  Emit this warning from the GC shutdown procedure, rather than just printing to stderr.
........
  r85828 | georg.brandl | 2010-10-24 22:47:32 +0200 (So, 24 Okt 2010) | 1 line

  These are true PyCFunctions, after adding the second argument to oss_self, no need to cast.
........
  r85856 | georg.brandl | 2010-10-27 09:27:06 +0200 (Mi, 27 Okt 2010) | 1 line

  #5975: add unix_dialect to csv module.
........
  r85874 | georg.brandl | 2010-10-28 08:42:33 +0200 (Do, 28 Okt 2010) | 1 line

  #7351: add more consistent exception name alias.
........
  r85876 | georg.brandl | 2010-10-28 11:03:20 +0200 (Do, 28 Okt 2010) | 1 line

  #10218: return timeout status from Condition.wait, mirroring other primitives' behavior.
........
  r85877 | georg.brandl | 2010-10-28 11:24:56 +0200 (Do, 28 Okt 2010) | 1 line

  Condition.wait now returns bool.
........
  r85888 | georg.brandl | 2010-10-28 15:01:06 +0200 (Do, 28 Okt 2010) | 1 line

  Support new Condition return value in the multiprocessing version.
........
  r85889 | georg.brandl | 2010-10-28 15:07:50 +0200 (Do, 28 Okt 2010) | 1 line

  Review new Barrier docs.
........
  r85910 | georg.brandl | 2010-10-29 07:30:17 +0200 (Fr, 29 Okt 2010) | 1 line

  Port suspicious markup builder and patchlevel.py so that they can be used with Python 2 and 3 without conversion.
........
  r85979 | georg.brandl | 2010-10-30 16:33:28 +0200 (Sa, 30 Okt 2010) | 1 line

  Fix test_mailbox by supporting context manager protocol for get_file() returns.
........
1 parent f55aa80
Raw File
Tip revision: 4df89ed58c656580e1681904c8770536909657fc authored by Georg Brandl on 26 November 2010, 09:00:28 UTC
Blocked revisions 85680-85683,85692,85787-85789,85807,85822,85824,85828,85856,85874,85876-85877,85888-85889,85910,85979 via svnmerge
Tip revision: 4df89ed
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