summaryrefslogtreecommitdiff
path: root/compat.py
diff options
context:
space:
mode:
Diffstat (limited to 'compat.py')
-rw-r--r--compat.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/compat.py b/compat.py
index 0a11341..521b8e6 100644
--- a/compat.py
+++ b/compat.py
@@ -7,6 +7,7 @@ from __future__ import print_function
import sys
import os
import types
+import sysconfig
if False: # MYPY
from typing import Any, Dict, Optional, List, Union, BinaryIO, IO, Text, Tuple # NOQA
@@ -112,6 +113,10 @@ if PY3:
else:
builtins_module = '__builtin__'
+UNICODE_SIZE = sysconfig.get_config_var('Py_UNICODE_SIZE')
+if UNICODE_SIZE is None: # on Python >= 3.3 unicode has no fixed bytesize
+ UNICODE_SIZE = 4
+
def with_metaclass(meta, *bases):
# type: (Any, Any) -> Any