Exemple #1
0
            extra_flags = ["expect_failure"],
            search_mode = search_mode,
            needs_2to3  = False
        )
    else:
        my_print("OK")

        if os.name == "nt":
            suffix = "pyd"
        else:
            suffix = "so"

        target_filename = os.path.basename(path).replace(".py",'.'+suffix)
        target_filename = target_filename.replace('(',"").replace(')',"")

        os.unlink(
            os.path.join(
                stage_dir, target_filename
            )
        )



compileLibraryTest(
    search_mode = search_mode,
    stage_dir   = os.path.join(tmp_dir, "compile_library"),
    decide      = decide,
    action      = action
)

Exemple #2
0
    assert path.startswith(root)

    module_name = path[len(root) + 1:]
    module_name = module_name.split(".")[0]
    module_name = module_name.replace(os.path.sep, ".")

    with open(filename, "w") as output:
        output.write("import " + module_name + "\n")
        output.write("print('OK')")

    command += os.environ.get("NUITKA_EXTRA_OPTIONS", "").split()

    command.append(filename)

    try:
        output = subprocess.check_output(command).splitlines()
        assert output[-1] == "OK", output
    except Exception as e:
        print(e)
        sys.exit(1)
    else:
        my_print("OK")

        shutil.rmtree(filename[:-3] + ".dist")


compileLibraryTest(search_mode=search_mode,
                   stage_dir=os.path.join(tmp_dir, "compile_library"),
                   decide=decide,
                   action=action)