e44204dcffff1053cc43142b9e9315a30d590c46,lib/streamlit/process_runner.py,,run_handling_errors_in_this_process,#Any#Any#,75

Before Change



        if parsed_err:
            import streamlit as st
            exc_type, exc_message, exc_tb = parsed_err
            st._text_exception(exc_type, exc_message, exc_tb)
        else:
            // If we couldn"t find the exception type, then maybe the script

After Change


    if process.returncode != 0 and len(stderr_str) > 0:
	// Catch errors that are output by Python when parsing the script. In
        // particular, here we look for errors that have a traceback.
        if (_TRACE_FILE_LINE_RE.search(stderr_str)
                // Only parse errors that were not handled by Streamlit already.
                and util.EXCEPTHOOK_IDENTIFIER_STR not in stderr_str):

            parsed_err = _parse_exception_text(stderr_str)

            // This part of the code needs to be done in a process separate from
            // the Proxy process, since st.foo creates WebSocket connection.

            if parsed_err:
                import streamlit as st
            else:
                // If we couldn"t find the exception type, then maybe the script
                // just returns an error code and prints something to stderr. So
                // let"s not replace the report with the contents of stderr
                // because that would be annoying.
                pass

	// Catch errors that are output by the Python interpreter when it
        // encounters OS-level issues when it tries to open the script itself.
        // These always look like:
        // "python: some message: [Errno some-number] some message".
        else:
            m = _ERRNO_RE.match(stderr_str)
            import streamlit as st
            st._text_exception(
                m.group("errno"), m.group("errmsg"), [m.group("msg")])


def run_python_module(module, *args):
    Run a Python module"s main function in a subprocess.

    Parameters
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: streamlit/streamlit
Commit Name: e44204dcffff1053cc43142b9e9315a30d590c46
Time: 2019-03-12
Author: 44782696+aaj-st@users.noreply.github.com
File Name: lib/streamlit/process_runner.py
Class Name:
Method Name: run_handling_errors_in_this_process


Project Name: floydhub/dockerfiles
Commit Name: 5ac177662e054b9b8f4ad95fc9053561cc69a6a8
Time: 2017-06-20
Author: dave2008713@gmail.com
File Name: floydker/src/floydker/utils.py
Class Name:
Method Name: gen_target_env_from_tag


Project Name: eth-cscs/reframe
Commit Name: 0f1c2a98960c6e3ba8d48e4f00ad358ccb204f07
Time: 2020-09-15
Author: karakasis@cscs.ch
File Name: reframe/core/schedulers/slurm.py
Class Name: SlurmJobScheduler
Method Name: poll