Files
django_lottopy/django_lottopy/lib/python3.12/site-packages/excel_base/compat.py
T
admin b41c070546 Rebuild venv for python 3.12 (alpine 3.20), gunicorn 25, quieter logs, ignore rotated logs
Whole-site snapshot so the repo works as a restorable backup of the server code and its virtualenv.
2026-10-10 15:16:53 -04:00

47 lines
760 B
Python

# -*- coding: utf-8 -*-
"""
pythoncompat
"""
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
# ---------
# Specifics
# ---------
if is_py2:
builtin_str = str
str = unicode
bytes = str
basestring = basestring
numeric_types = (int, long, float)
try:
from cStringIO import StringIO
from cStringIO import StringIO as BytesIO
except ImportError:
from StringIO import StringIO
from StringIO import StringIO as BytesIO
elif is_py3:
builtin_str = str
str = str
bytes = bytes
basestring = (str, bytes)
numeric_types = (int, float)
from io import BytesIO, StringIO