summaryrefslogtreecommitdiff
path: root/compat.py
diff options
context:
space:
mode:
authorMarcel Bargull <marcel.bargull@udo.edu>2018-07-12 06:58:14 -0500
committerMarcel Bargull <marcel.bargull@udo.edu>2018-07-12 06:58:14 -0500
commit37eab03d7db75e550652658bd1af1988cb0f1707 (patch)
tree4269378320d9bb965d50b943d4349174af8876d7 /compat.py
parent7c118cd53e4bc21de23c8db0c2bb58048a403f1c (diff)
downloadruamel.yaml-37eab03d7db75e550652658bd1af1988cb0f1707.tar.gz
on Windows+PY2 get_config_var('Py_UNICODE_SIZE') is None
Diffstat (limited to 'compat.py')
-rw-r--r--compat.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/compat.py b/compat.py
index 521b8e6..022762b 100644
--- a/compat.py
+++ b/compat.py
@@ -7,7 +7,6 @@ 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
@@ -113,9 +112,7 @@ 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
+UNICODE_SIZE = 4 if sys.maxunicode > 65535 else 2
def with_metaclass(meta, *bases):