Skip to content

Commit

Permalink
Preconditions script is python3 only
Browse files Browse the repository at this point in the history
The preconditions script attempts to catch the FileNotFoundError
exception, which is only defined in Python3. This commit updates the
preconditions shell wrapper to search for python3 and updates the
preconditions script shebang accordingly.
  • Loading branch information
adrienthebo committed Jan 10, 2019
1 parent 59bae54 commit 2a5b6d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/preconditions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if command -v python 1>/dev/null; then
if command -v python3 1>/dev/null; then
BASEDIR="$(dirname "$0")"
SCRIPT="$BASEDIR/preconditions/preconditions.py"
exec "$SCRIPT" "$@"
else
echo "Unable to check project-factory preconditions: python executable not in PATH" 1>&2
echo "Unable to check project-factory preconditions: python3 executable not in PATH" 1>&2
fi
2 changes: 1 addition & 1 deletion scripts/preconditions/preconditions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Copyright 2018 Google LLC
#
Expand Down

0 comments on commit 2a5b6d7

Please sign in to comment.