Skip to content

Commit

Permalink
Use python3 instead of python
Browse files Browse the repository at this point in the history
This fixes a few stragglers after 6a17e84
  • Loading branch information
keith committed Feb 15, 2023
1 parent e129ff3 commit 8a02798
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function(check_platform_supports_browse_mode RESULT)

endfunction()

set(NINJA_PYTHON "python" CACHE STRING "Python interpreter to use for the browse tool")
set(NINJA_PYTHON "python3" CACHE STRING "Python interpreter to use for the browse tool")

check_platform_supports_browse_mode(platform_supports_ninja_browse)

Expand Down Expand Up @@ -240,6 +240,10 @@ if(BUILD_TESTING)
manifest_parser_perftest
)
add_executable(${perftest} src/${perftest}.cc)
set_source_files_properties(src/${perftest}.cc
PROPERTIES
COMPILE_DEFINITIONS NINJA_PYTHON="${NINJA_PYTHON}"
)
target_link_libraries(${perftest} PRIVATE libninja libninja-re2c)
endforeach()

Expand Down
2 changes: 0 additions & 2 deletions misc/ninja_syntax.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python

# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion misc/write_fake_manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
ones used in the Chromium project.
Usage:
python misc/write_fake_manifests.py outdir # Will run for about 5s.
python3 misc/write_fake_manifests.py outdir # Will run for about 5s.
The program contains a hardcoded random seed, so it will generate the same
output every time it runs. By changing the seed, it's easy to generate many
Expand Down
2 changes: 1 addition & 1 deletion src/manifest_parser_perftest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ bool WriteFakeManifests(const string& dir, string* err) {
if (mtime != 0) // 0 means that the file doesn't exist yet.
return mtime != -1;

string command = "python misc/write_fake_manifests.py " + dir;
string command = NINJA_PYTHON " misc/write_fake_manifests.py " + dir;
printf("Creating manifest data..."); fflush(stdout);
int exit_code = system(command.c_str());
printf("done.\n");
Expand Down

0 comments on commit 8a02798

Please sign in to comment.