1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-27 18:17:46 +00:00
bazarr/libs/pysrt/compat.py
2018-09-16 20:33:04 -04:00

22 lines
315 B
Python

import sys
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
from io import open as io_open
if is_py2:
basestring = basestring
str = unicode
open = io_open
elif is_py3:
basestring = (str, bytes)
str = str
open = open