File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77
88""" #"
99
10- import struct , __builtin__
10+ import __builtin__ , sys
1111
1212### Registry and builtin stateless codec functions
1313
4848# UTF-32, big endian
4949BOM_UTF32_BE = '\x00 \x00 \xfe \xff '
5050
51- # UTF-16, native endianness
52- BOM = BOM_UTF16 = struct .pack ('=H' , 0xFEFF )
51+ if sys .byteorder == 'little' :
5352
54- # UTF-32, native endianness
55- BOM_UTF32 = struct .pack ('=L' , 0x0000FEFF )
53+ # UTF-16, native endianness
54+ BOM = BOM_UTF16 = BOM_UTF16_LE
55+
56+ # UTF-32, native endianness
57+ BOM_UTF32 = BOM_UTF32_LE
58+
59+ else :
60+
61+ # UTF-16, native endianness
62+ BOM = BOM_UTF16 = BOM_UTF16_BE
63+
64+ # UTF-32, native endianness
65+ BOM_UTF32 = BOM_UTF32_BE
5666
5767# Old broken names (don't use in new code)
5868BOM32_LE = BOM_UTF16_LE
Original file line number Diff line number Diff line change 1010@USE_SIGNAL_MODULE@signal signalmodule.c
1111
1212# The rest of the modules previously listed in this file are built
13- # by the setup.py script in Python 2.1.
13+ # by the setup.py script in Python 2.1 and later .
Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ PYTHONPATH=$(COREPYTHONPATH)
111111posix posixmodule.c # posix (UNIX) system calls
112112errno errnomodule.c # posix (UNIX) errno values
113113_sre _sre.c # Fredrik Lundh's new regular expressions
114+ _codecs _codecsmodule.c # access to the builtin codecs and codec registry
114115
115116# The rest of the modules listed in this file are all commented out by
116117# default. Usually they can be detected and built as dynamically
@@ -163,7 +164,6 @@ GLHACK=-Dclear=__GLclear
163164# time timemodule.c # -lm # time operations and variables
164165# operator operator.c # operator.add() and similar goodies
165166# _weakref _weakref.c # basic weak reference support
166- # _codecs _codecsmodule.c # access to the builtin codecs and codec registry
167167# _testcapi _testcapimodule.c # Python C API test module
168168
169169# unicodedata unicodedata.c # static Unicode character database
Original file line number Diff line number Diff line change @@ -313,8 +313,6 @@ def detect_modules(self):
313313 libraries = math_libs ) )
314314 # operator.add() and similar goodies
315315 exts .append ( Extension ('operator' , ['operator.c' ]) )
316- # access to the builtin codecs and codec registry
317- exts .append ( Extension ('_codecs' , ['_codecsmodule.c' ]) )
318316 # Python C API test module
319317 exts .append ( Extension ('_testcapi' , ['_testcapimodule.c' ]) )
320318 # static Unicode character database
You can’t perform that action at this time.
0 commit comments