File: six.py

package info (click to toggle)
python-ptrace 0.6.4-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 620 kB
  • sloc: python: 6,213; ansic: 241; makefile: 13; sh: 1
file content (18 lines) | stat: -rw-r--r-- 335 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Copy/paste useful parts of six, a module written by Benjamin Peterson and
# distributed under the MIT license:
# http://pypi.python.org/pypi/six/

import sys

PY3 = sys.version_info[0] == 3

if PY3:
    binary_type = bytes

    def b(s):
        return s.encode("latin-1")
else:
    binary_type = str

    def b(s):
        return s