Lines Matching +full:py3 +full:- +full:six
2 # Use of this source code is governed by a BSD-style license that can be
4 """Miscellaneous Python 2-3 compatibility functions.
6 Seven is an extension to the compatibility layer six.
8 to Python 3, but aren't present in the six library.
11 import six
12 import six.moves.configparser
17 if six.PY3:
44 control files in autotest and prevent compiler-wide settings like
46 have not yet been made Python 3-compatible.
54 None (output of six.exec_)
64 return six.exec_(code_obj, globals_, locals_)
68 """config_parser returns a non-strict config parser.
70 Unfortunately, in six configparser is not same between 2/3. For our .ini's
73 if six.PY3:
74 return six.moves.configparser.ConfigParser(args, strict=False)
75 return six.moves.configparser.ConfigParser(args)
78 def ensure_text(s, encoding='utf-8', errors='strict'):
79 """Coerce *s* to six.text_type. Copied from six lib.
82 - `unicode` -> `unicode`
83 - `str` -> `unicode`
85 - `str` -> `str`
86 - `bytes` -> decoded to `str`
97 """ensure_long returns a long if py2, or int if py3."""
98 if six.PY2: