Skip to content

Commit

Permalink
Tweak how python/python3 is used.
Browse files Browse the repository at this point in the history
The kokoro Mac configs seem to be pretty old without python3, tweak how things
are invoked to try and better deal with those configs.
  • Loading branch information
thomasvl committed Apr 5, 2022
1 parent 205117c commit ca30339
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions objectivec/DevTools/full_mac_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,14 @@ fi
objectivec/generate_well_known_types.sh --check-only -j "${NUM_MAKE_JOBS}"

header "Checking on the ObjC Runtime Code"
objectivec/DevTools/pddm_tests.py
if ! objectivec/DevTools/pddm.py --dry-run objectivec/*.[hm] objectivec/Tests/*.[hm] ; then
# Some of the kokoro machines don't have python3 yet, so fall back to python if need be.
if hash python3 >/dev/null 2>&1 ; then
LOCAL_PYTHON=python3
else
LOCAL_PYTHON=python
fi
"${LOCAL_PYTHON}" objectivec/DevTools/pddm_tests.py
if ! "${LOCAL_PYTHON}" objectivec/DevTools/pddm.py --dry-run objectivec/*.[hm] objectivec/Tests/*.[hm] ; then
echo ""
echo "Update by running:"
echo " objectivec/DevTools/pddm.py objectivec/*.[hm] objectivec/Tests/*.[hm]"
Expand Down
2 changes: 1 addition & 1 deletion objectivec/DevTools/pddm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/python3
#! /usr/bin/env python3
#
# Protocol Buffers - Google's data interchange format
# Copyright 2015 Google Inc. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion objectivec/DevTools/pddm_tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/python3
#! /usr/bin/env python3
#
# Protocol Buffers - Google's data interchange format
# Copyright 2015 Google Inc. All rights reserved.
Expand Down

0 comments on commit ca30339

Please sign in to comment.