From 9f563bd0d8863da35524f7d0a6f87abb2ec228a3 Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Mon, 6 Jul 2015 16:07:57 -0700 Subject: Internal local modifications. --- python/google/protobuf/internal/test_util.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'python') diff --git a/python/google/protobuf/internal/test_util.py b/python/google/protobuf/internal/test_util.py index 0cbdbad9..fec65382 100755 --- a/python/google/protobuf/internal/test_util.py +++ b/python/google/protobuf/internal/test_util.py @@ -602,6 +602,13 @@ def GoldenFile(filename): return open(full_path, 'rb') path = os.path.join(path, '..') + # Search internally. + path = '.' + full_path = os.path.join(path, 'third_party/py/google/protobuf/testdata', filename) + if os.path.exists(full_path): + # Found it. Load the golden file from the testdata directory. + return open(full_path, 'rb') + raise RuntimeError( 'Could not find golden files. This test must be run from within the ' 'protobuf source package so that it can read test data files from the ' -- cgit v1.2.3