/usr/lib/python3/dist-packages/neovim/compat.py is in python3-neovim 0.2.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | """Code for supporting compatibility across python versions."""
import sys
from imp import find_module as original_find_module
IS_PYTHON3 = sys.version_info >= (3, 0)
if IS_PYTHON3:
def find_module(fullname, path):
"""Compatibility wrapper for imp.find_module.
Automatically decodes arguments of find_module, in Python3
they must be Unicode
"""
if isinstance(fullname, bytes):
fullname = fullname.decode()
if isinstance(path, bytes):
path = path.decode()
elif isinstance(path, list):
newpath = []
for element in path:
if isinstance(element, bytes):
newpath.append(element.decode())
else:
newpath.append(element)
path = newpath
return original_find_module(fullname, path)
# There is no 'long' type in Python3 just int
long = int
unicode_errors_default = 'surrogateescape'
else:
find_module = original_find_module
unicode_errors_default = 'strict'
NUM_TYPES = (int, long, float)
|