import os
import sys
JYTHON = sys.platform.startswith('java')
IRONPYTHON = sys.platform == 'cli'
PYPY = 'PyPy' in sys.version
PYTHON = not (JYTHON or IRONPYTHON) # PyPY and CPython work mostly same way
PY2 = sys.version_info[0] == 2
PY3 = not PY2
UNIXY = os.sep == '/'
WINDOWS = not UNIXY
RERAISED_EXCEPTIONS = (KeyboardInterrupt, SystemExit, MemoryError)
if JYTHON:
from java.lang import OutOfMemoryError
RERAISED_EXCEPTIONS += (OutOfMemoryError,)
if WINDOWS:
CASE_INSENSITIVE_FILESYSTEM = True
else:
try:
CASE_INSENSITIVE_FILESYSTEM = os.listdir('/tmp') == os.listdir('/TMP')
except OSError:
CASE_INSENSITIVE_FILESYSTEM = False