/usr/lib/python2.7/dist-packages/scripttest/backwardscompat.py is in python-scripttest 1.2-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 | import sys
def string(string):
if sys.version_info >= (3,):
if isinstance(string, str):
return string
return str(string, "utf-8")
else:
if isinstance(string, unicode):
return string
return string.decode('utf-8')
|