mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-21 16:05:02 +02:00
Import pyte
This commit is contained in:
26
pyte/compat.py
Normal file
26
pyte/compat.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
pyte.compat
|
||||
~~~~~~~~~~~
|
||||
|
||||
Python version specific compatibility fixes.
|
||||
|
||||
:copyright: (c) 2015-2016 by pyte authors and contributors,
|
||||
see AUTHORS for details.
|
||||
:license: LGPL, see LICENSE for more details.
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
if sys.version_info[0] == 2:
|
||||
from future_builtins import map
|
||||
|
||||
range = xrange
|
||||
str = unicode
|
||||
chr = unichr
|
||||
|
||||
from functools import partial
|
||||
iter_bytes = partial(map, ord)
|
||||
else:
|
||||
from builtins import map, range, str, chr
|
||||
iter_bytes = iter
|
||||
Reference in New Issue
Block a user