Find the protoc from environ first for python.

This commit is contained in:
liujisi@google.com 2012-12-05 01:25:12 +00:00
parent 8cc2017f34
commit e34f1f63b6

View file

@ -26,7 +26,9 @@ from distutils.spawn import find_executable
maintainer_email = "protobuf@googlegroups.com"
# Find the Protocol Compiler.
if os.path.exists("../src/protoc"):
if 'PROTOC' in os.environ and os.path.exists(os.environ['PROTOC']):
protoc = os.environ['PROTOC']
elif os.path.exists("../src/protoc"):
protoc = "../src/protoc"
elif os.path.exists("../src/protoc.exe"):
protoc = "../src/protoc.exe"