Exemplo n.º 1
0
def run_path(path, args):
    "Replacement for runpy.run_path when it doesn't exist"

    if has_run_path:
        sys.argv = ["foo"] + [str(arg) for arg in args]
        runpy_run_path(path)
    else:
        status = os.system("python " + path + " " + \
                           " ".join(str(arg) for arg in args))
        if not status == 0:
            raise RuntimeError, "Python script failed"
Exemplo n.º 2
0
def run_path(path, args):
    "Replacement for runpy.run_path when it doesn't exist"

    if has_run_path:
        sys.argv = ["foo"] + [str(arg) for arg in args]
        runpy_run_path(path)
    else:
        status = os.system("python " + path + " " + \
                           " ".join(str(arg) for arg in args))
        if not status == 0:
            raise RuntimeError, "Python script failed"
Exemplo n.º 3
0
def run_path(path, args):
    "Replacement for runpy.run_path when it doesn't exist"

    sys.argv = ["foo"] + [str(arg) for arg in args]
    try:
        runpy_run_path(path)
    except SystemExit as e:
        if e.args[0] == 0:
            pass
        else:
            raise e
Exemplo n.º 4
0
def run_path(path, args):
    "Replacement for runpy.run_path when it doesn't exist"

    sys.argv = ["foo"] + [str(arg) for arg in args]
    try:
        runpy_run_path(path)
    except SystemExit as e:
        if e.args[0] == 0:
            pass
        else:
            raise e