summaryrefslogtreecommitdiff
path: root/compat.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2018-07-01 16:25:00 +0200
committerAnthon van der Neut <anthon@mnt.org>2018-07-01 16:25:00 +0200
commitc3869f9866e3507bbb6767aeb5bc02ba41a98d60 (patch)
treed901c684ffdb978a02dd83a728e609e6a07c8b97 /compat.py
parent4eed1d5eef4f20ea32ee7af1f01d02ffcc7e229c (diff)
downloadruamel.yaml-c3869f9866e3507bbb6767aeb5bc02ba41a98d60.tar.gz
fix regression caused by PR 270.15.42
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