Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b5c980b

Browse files
committed
Add unidata_version. Bump generator version number.
1 parent 05ced6a commit b5c980b

6 files changed

Lines changed: 19 additions & 5 deletions

File tree

Doc/lib/libunicodedata.tex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,10 @@ \section{\module{unicodedata} ---
117117
\versionadded{2.3}
118118
\end{funcdesc}
119119

120+
In addition, the module exposes the following constant:
121+
122+
\begin{datadesc}{unidata_version}
123+
The version of the Unicode database used in this module.
124+
125+
\versionadded{2.3}
126+
\end{datadesc}

Modules/unicodedata.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,8 @@ initunicodedata(void)
881881
if (!m)
882882
return;
883883

884+
PyModule_AddStringConstant(m, "unidata_version", UNIDATA_VERSION);
885+
884886
/* Export C API */
885887
v = PyCObject_FromVoidPtr((void *) &hashAPI, NULL);
886888
if (v != NULL)

Modules/unicodedata_db.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
/* this file was generated by Tools/unicode/makeunicodedata.py 2.1 */
1+
/* this file was generated by Tools/unicode/makeunicodedata.py 2.2 */
22

3+
#define UNIDATA_VERSION "3.2.0"
34
/* a list of unique database records */
45
const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {
56
{0, 0, 0, 0},

Modules/unicodename_db.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* this file was generated by Tools/unicode/makeunicodedata.py 2.1 */
1+
/* this file was generated by Tools/unicode/makeunicodedata.py 2.2 */
22

33
#define NAME_MAXLEN 256
44

Objects/unicodetype_db.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* this file was generated by Tools/unicode/makeunicodedata.py 2.1 */
1+
/* this file was generated by Tools/unicode/makeunicodedata.py 2.2 */
22

33
/* a list of unique character type descriptors */
44
const _PyUnicode_TypeRecord _PyUnicode_TypeRecords[] = {

Tools/unicode/makeunicodedata.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# (re)generate unicode property and type databases
33
#
4-
# this script converts a unicode 3.0 database file to
4+
# this script converts a unicode 3.2 database file to
55
# Modules/unicodedata_db.h, Modules/unicodename_db.h,
66
# and Objects/unicodetype_db.h
77
#
@@ -17,15 +17,18 @@
1717
# 2002-10-18 mvl update to Unicode 3.2
1818
# 2002-10-22 mvl generate NFC tables
1919
# 2002-11-24 mvl expand all ranges, sort names version-independently
20+
# 2002-11-25 mvl add UNIDATA_VERSION
2021
#
2122
# written by Fredrik Lundh ([email protected])
2223
#
2324

2425
import sys
2526

2627
SCRIPT = sys.argv[0]
27-
VERSION = "2.1"
28+
VERSION = "2.2"
2829

30+
# The Unicode Database
31+
UNIDATA_VERSION = "3.2.0"
2932
UNICODE_DATA = "UnicodeData.txt"
3033
COMPOSITION_EXCLUSIONS = "CompositionExclusions.txt"
3134

@@ -192,6 +195,7 @@ def makeunicodedata(unicode, trace):
192195
fp = open(FILE, "w")
193196
print >>fp, "/* this file was generated by %s %s */" % (SCRIPT, VERSION)
194197
print >>fp
198+
print >>fp, '#define UNIDATA_VERSION "%s"' % UNIDATA_VERSION
195199
print >>fp, "/* a list of unique database records */"
196200
print >>fp, \
197201
"const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {"

0 commit comments

Comments
 (0)