sys.version_info.minor

Here are the examples of the python api sys.version_info.minor taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

18 Examples 7

Example 1

View license
def literal_eval(string):
    # py3.0, py3.1 and py32 don't support unicode literals. Support those, I
    # don't want to write two versions of the tokenizer.
    if is_py3 and sys.version_info.minor < 3:
        if re.match('[uU][\'"]', string):
            string = string[1:]
    return ast.literal_eval(string)

Example 2

Project: YouCompleteMe-x64
Source File: _compatibility.py
View license
def literal_eval(string):
    # py3.0, py3.1 and py32 don't support unicode literals. Support those, I
    # don't want to write two versions of the tokenizer.
    if is_py3 and sys.version_info.minor < 3:
        if re.match('[uU][\'"]', string):
            string = string[1:]
    return ast.literal_eval(string)

Example 3

Project: YouCompleteMe-x86
Source File: _compatibility.py
View license
def literal_eval(string):
    # py3.0, py3.1 and py32 don't support unicode literals. Support those, I
    # don't want to write two versions of the tokenizer.
    if is_py3 and sys.version_info.minor < 3:
        if re.match('[uU][\'"]', string):
            string = string[1:]
    return ast.literal_eval(string)

Example 4

Project: SublimeJEDI
Source File: _compatibility.py
View license
def literal_eval(string):
    # py3.0, py3.1 and py32 don't support unicode literals. Support those, I
    # don't want to write two versions of the tokenizer.
    if is_py3 and sys.version_info.minor < 3:
        if re.match('[uU][\'"]', string):
            string = string[1:]
    return ast.literal_eval(string)

Example 5

Project: protofuzz
Source File: pbimport.py
View license
def _load_module(path):
    'Helper to load a Python file at path and return as a module'

    module_name = os.path.splitext(os.path.basename(path))[0]

    module = None
    if sys.version_info.minor < 5:
        loader = importlib.machinery.SourceFileLoader(module_name, path)
        module = loader.load_module()
    else:
        spec = importlib.util.spec_from_file_location(module_name, path)
        module = importlib.util.module_from_spec(spec)
        spec.loader.exec_module(module)

    return module

Example 6

Project: YCM_WIN_X86
Source File: _compatibility.py
View license
def literal_eval(string):
    # py3.0, py3.1 and py32 don't support unicode literals. Support those, I
    # don't want to write two versions of the tokenizer.
    if is_py3 and sys.version_info.minor < 3:
        if re.match('[uU][\'"]', string):
            string = string[1:]
    return ast.literal_eval(string)

Example 7

Project: CNCGToolKit
Source File: _compatibility.py
View license
def literal_eval(string):
    # py3.0, py3.1 and py32 don't support unicode literals. Support those, I
    # don't want to write two versions of the tokenizer.
    if is_py3 and sys.version_info.minor < 3:
        if re.match('[uU][\'"]', string):
            string = string[1:]
    return ast.literal_eval(string)

Example 8

Project: pythonVSCode
Source File: _compatibility.py
View license
def literal_eval(string):
    # py3.0, py3.1 and py32 don't support unicode literals. Support those, I
    # don't want to write two versions of the tokenizer.
    if is_py3 and sys.version_info.minor < 3:
        if re.match('[uU][\'"]', string):
            string = string[1:]
    return ast.literal_eval(string)

Example 9

Project: pyhackedit
Source File: _compatibility.py
View license
def literal_eval(string):
    # py3.0, py3.1 and py32 don't support unicode literals. Support those, I
    # don't want to write two versions of the tokenizer.
    if is_py3 and sys.version_info.minor < 3:
        if re.match('[uU][\'"]', string):
            string = string[1:]
    return ast.literal_eval(string)

Example 10

View license
def literal_eval(string):
    # py3.0, py3.1 and py32 don't support unicode literals. Support those, I
    # don't want to write two versions of the tokenizer.
    if is_py3 and sys.version_info.minor < 3:
        if re.match('[uU][\'"]', string):
            string = string[1:]
    return ast.literal_eval(string)

Example 11

View license
def literal_eval(string):
    # py3.0, py3.1 and py32 don't support unicode literals. Support those, I
    # don't want to write two versions of the tokenizer.
    if is_py3 and sys.version_info.minor < 3:
        if re.match('[uU][\'"]', string):
            string = string[1:]
    return ast.literal_eval(string)

Example 12

Project: SublimePythonIDE
Source File: _compatibility.py
View license
def literal_eval(string):
    # py3.0, py3.1 and py32 don't support unicode literals. Support those, I
    # don't want to write two versions of the tokenizer.
    if is_py3 and sys.version_info.minor < 3:
        if re.match('[uU][\'"]', string):
            string = string[1:]
    return ast.literal_eval(string)

Example 13

Project: SublimePythonIDE
Source File: _compatibility.py
View license
def literal_eval(string):
    # py3.0, py3.1 and py32 don't support unicode literals. Support those, I
    # don't want to write two versions of the tokenizer.
    if is_py3 and sys.version_info.minor < 3:
        if re.match('[uU][\'"]', string):
            string = string[1:]
    return ast.literal_eval(string)

Example 14

Project: python-tools
Source File: _compatibility.py
View license
def literal_eval(string):
    # py3.0, py3.1 and py32 don't support unicode literals. Support those, I
    # don't want to write two versions of the tokenizer.
    if is_py3 and sys.version_info.minor < 3:
        if re.match('[uU][\'"]', string):
            string = string[1:]
    return ast.literal_eval(string)

Example 15

Project: python-tools
Source File: _compatibility.py
View license
def literal_eval(string):
    # py3.0, py3.1 and py32 don't support unicode literals. Support those, I
    # don't want to write two versions of the tokenizer.
    if is_py3 and sys.version_info.minor < 3:
        if re.match('[uU][\'"]', string):
            string = string[1:]
    return ast.literal_eval(string)

Example 16

Project: python3-openid
Source File: parsehtml.py
View license
    def __init__(self):
        if (sys.version_info.minor <= 2):
            # Python 3.2 and below actually require the `strict` argument
            # to `html.parser.HTMLParser` -- otherwise it's deprecated and
            # we don't want to pass it
            super(YadisHTMLParser, self).__init__(strict=False)
        else:
            super(YadisHTMLParser, self).__init__()
        self.phase = self.TOP

Example 17

Project: python3-openid
Source File: parsehtml.py
View license
    def __init__(self):
        if (sys.version_info.minor <= 2):
            # Python 3.2 and below actually require the `strict` argument
            # to `html.parser.HTMLParser` -- otherwise it's deprecated and
            # we don't want to pass it
            super(YadisHTMLParser, self).__init__(strict=False)
        else:
            super(YadisHTMLParser, self).__init__()
        self.phase = self.TOP

Example 18

Project: fbuild
Source File: killableprocess.py
View license
        def _execute_child(self, *params):
            pyver = sys.version_info.minor
            if pyver == 1:
                args, executable, preexec_fn, close_fds,\
                cwd, env, universal_newlines,\
                startupinfo, creationflags, shell,\
                p2cread, p2cwrite,\
                errread, errwrite = params
            elif pyver == 2:
                args, executable, preexec_fn, close_fds,\
                pass_fds, cwd, env, universal_newlines,\
                startupinfo, creationflags, shell,\
                p2cread, p2cwrite,\
                c2pread, c2pwrite,\
                errread, errwrite,\
                unused_restore_signals, unused_start_new_session = params
            else:
                args, executable, preexec_fn, close_fds,\
                pass_fds, cwd, env,\
                startupinfo, creationflags, shell,\
                p2cread, p2cwrite,\
                c2pread, c2pwrite,\
                errread, errwrite,\
                unused_restore_signals, unused_start_new_session = params
            if not isinstance(args, str):
                args = subprocess.list2cmdline(args)

            if startupinfo is None:
                startupinfo = winprocess.STARTUPINFO()

            if None not in (p2cread, c2pwrite, errwrite):
                startupinfo.dwFlags |= winprocess.STARTF_USESTDHANDLES

                startupinfo.hStdInput = int(p2cread)
                startupinfo.hStdOutput = int(c2pwrite)
                startupinfo.hStdError = int(errwrite)
            if shell:
                startupinfo.dwFlags |= winprocess.STARTF_USESHOWWINDOW
                startupinfo.wShowWindow = winprocess.SW_HIDE
                comspec = os.environ.get("COMSPEC", "cmd.exe")
                args = comspec + " /c " + args
                if (GetVersion() >= 0x80000000 or
                        os.path.basename(comspec).lower() == "command.com"):
                    # Win9x, or using command.com on NT. We need to
                    # use the w9xpopen intermediate program. For more
                    # information, see KB Q150956
                    # (http://web.archive.org/web/20011105084002/http://support.microsoft.com/support/kb/articles/Q150/9/56.asp)
                    w9xpopen = self._find_w9xpopen()
                    args = '"%s" %s' % (w9xpopen, args)
                    # Not passing CREATE_NEW_CONSOLE has been known to
                    # cause random failures on win9x.  Specifically a
                    # dialog: "Your program accessed mem currently in
                    # use at xxx" and a hopeful warning about the
                    # stability of your system.  Cost is Ctrl+C wont
                    # kill children.
                    creationflags |= CREATE_NEW_CONSOLE

            # We create a new job for this process, so that we can kill
            # the process and any sub-processes
            self._job = winprocess.CreateJobObject()

            creationflags |= winprocess.CREATE_SUSPENDED
            creationflags |= winprocess.CREATE_UNICODE_ENVIRONMENT

            hp, ht, pid, tid = winprocess.CreateProcess(executable, args,
                # no special security
                None, None,
                int(not close_fds),
                creationflags,
                winprocess.EnvironmentBlock(env),
                cwd,
                startupinfo)

            self._child_created = True
            self._handle = hp
            self._thread = ht
            self.pid = pid

            winprocess.AssignProcessToJobObject(self._job, hp)
            winprocess.ResumeThread(ht)

            if p2cread is not None:
                p2cread.Close()
            if c2pwrite is not None:
                c2pwrite.Close()
            if errwrite is not None:
                errwrite.Close()