Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c183ed commit 535babcCopy full SHA for 535babc
setup.py
@@ -109,9 +109,17 @@ def build_extension(self, ext):
109
if not os.path.exists(dest_dir):
110
os.makedirs(dest_dir)
111
112
+ # Up to Python 3.2 sys.maxunicode is used to determine the size of Py_UNICODE
113
+ # but from 3.3 onwards Py_UNICODE is a typedef of wchar_t.
114
+ if sys.version_info[:2] <= (3, 2):
115
+ unicode_width = 2 if sys.maxunicode < 0x10FFFF else 4
116
+ else:
117
+ import ctypes
118
+ unicode_width = ctypes.sizeof(ctypes.c_wchar)
119
+
120
defines = [
121
"PYTHON%d%s" % (sys.version_info[:2]),
- "UCS2" if sys.maxunicode < 0x10FFFF else "UCS4",
122
+ "UCS%d" % unicode_width,
123
]
124
125
if CONFIG == "Debug":
0 commit comments