Convert two helper methods in bazel_workspaces_test.sh to Python 3.
Convert two helper methods in bazel_workspaces_test.sh to Python 3.

The shell script ran some Python 2.x only code using `python`, but the `python` executable is not guaranteed to be Python 2.x. On Arch Linux, it is Python 3.x.

Let's convert the code to Python 3 and then explicitly run it using `python3`, which should work on all systems where any version of Python 3 is installed (which is OK to assume now after the Python 2 deprecation).

RELNOTES: None.
PiperOrigin-RevId: 288448365

ButterflyNetwork/bazel,dslomov/bazel-windows,ulfjack/bazel,davidzchen/bazel,dslomov/bazel-windows,werkt/bazel,safarmer/bazel,akira-baruah/bazel,dslomov/bazel,davidzchen/bazel,bazelbuild/bazel,ulfjack/bazel,dslomov/bazel-windows,perezd/bazel,cushon/bazel,ButterflyNetwork/bazel,davidzchen/bazel,akira-baruah/bazel,perezd/bazel,safarmer/bazel,akira-baruah/bazel,twitter-forks/bazel,dslomov/bazel,dslomov/bazel,davidzchen/bazel,katre/bazel,ButterflyNetwork/bazel,katre/bazel,twitter-forks/bazel,ulfjack/bazel,werkt/bazel,ButterflyNetwork/bazel,cushon/bazel,werkt/bazel,cushon/bazel,dslomov/bazel,davidzchen/bazel,perezd/bazel,akira-baruah/bazel,twitter-forks/bazel,perezd/bazel,meteorcloudy/bazel,cushon/bazel,bazelbuild/bazel,cushon/bazel,davidzchen/bazel,dslomov/bazel,bazelbuild/bazel,katre/bazel,katre/bazel,ButterflyNetwork/bazel,safarmer/bazel,katre/bazel,bazelbuild/bazel,akira-baruah/bazel,katre/bazel,perezd/bazel,werkt/bazel,safarmer/bazel,akira-baruah/bazel,ulfjack/bazel,werkt/bazel,meteorcloudy/bazel,meteorcloudy/bazel,cushon/bazel,safarmer/bazel,meteorcloudy/bazel,werkt/bazel,twitter-forks/bazel,dslomov/bazel-windows,perezd/bazel,meteorcloudy/bazel,ulfjack/bazel,ulfjack/bazel,dslomov/bazel-windows,ulfjack/bazel,davidzchen/bazel,bazelbuild/bazel,bazelbuild/bazel,twitter-forks/bazel,dslomov/bazel,twitter-forks/bazel,ButterflyNetwork/bazel,meteorcloudy/bazel,twitter-forks/bazel,meteorcloudy/bazel,dslomov/bazel-windows,perezd/bazel,safarmer/bazel,dslomov/bazel