/usr/lib/python3/dist-packages/cutadapt/compat.py is in python3-cutadapt 1.9.1-1build1.
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 39 40 41 42 43 44 45 | # coding: utf-8
"""
Minimal Py2/Py3 compatibility library.
"""
from __future__ import print_function, division, absolute_import
import sys
PY3 = sys.version > '3'
if PY3:
maketrans = str.maketrans
basestring = str
zip = zip
next = next
def bytes_to_str(s):
return s.decode('ascii')
def str_to_bytes(s):
return s.encode('ascii')
def force_str(s):
if isinstance(s, bytes):
return s.decode('ascii')
else:
return s
from io import StringIO
else:
def bytes_to_str(s):
return s
def str_to_bytes(s):
return s
def force_str(s):
return s
def next(it):
return it.next()
from string import maketrans
basestring = basestring
from itertools import izip as zip
from StringIO import StringIO
|