HEX
Server: nginx/1.22.0
System: Linux iZuf6jdxbygmf6cco977lcZ 5.10.84-10.4.al8.x86_64 #1 SMP Tue Apr 12 12:31:07 CST 2022 x86_64
User: root (0)
PHP: 7.4.29
Disabled: passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen
Upload Files
File: //usr/local/aegis/PythonLoader/third_party/crossplane/compat.py
# -*- coding: utf-8 -*-
import functools
import sys

try:
    import simplejson as json
except ImportError:
    import json

PY2 = (sys.version_info[0] == 2)
PY3 = (sys.version_info[0] == 3)

if PY2:
    input = raw_input
    basestring = basestring
else:
    input = input
    basestring = str


def fix_pep_479(generator):
    """
    Python 3.7 breaks crossplane's lexer because of PEP 479
    Read more here: https://www.python.org/dev/peps/pep-0479/
    """
    @functools.wraps(generator)
    def _wrapped_generator(*args, **kwargs):
        try:
            for x in generator(*args, **kwargs):
                yield x
        except RuntimeError:
            return

    return _wrapped_generator