Merge pull request #5921 from haon4/contributing
Down integrate to Github
diff --git a/benchmarks/util/result_parser.py b/benchmarks/util/result_parser.py
index e3d8e42..fe19c85 100755
--- a/benchmarks/util/result_parser.py
+++ b/benchmarks/util/result_parser.py
@@ -29,7 +29,7 @@
def __extract_file_name(file_name):
- name_list = re.split("[/\.]", file_name)
+ name_list = re.split(r"[/\.]", file_name)
short_file_name = ""
for name in name_list:
if name[:14] == "google_message":
@@ -213,7 +213,7 @@
filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename
with open(filename) as f:
for line in f:
- result_list = re.split("[\ \t]+", line)
+ result_list = re.split(r"[\ \t]+", line)
if result_list[0][:9] != "Benchmark":
continue
first_slash_index = result_list[0].find('/')
diff --git a/js/message.js b/js/message.js
index 7adcc25..5ca0a73 100644
--- a/js/message.js
+++ b/js/message.js
@@ -41,7 +41,6 @@
goog.require('goog.array');
goog.require('goog.asserts');
goog.require('goog.crypt.base64');
-goog.require('jspb.BinaryConstants');
goog.require('jspb.BinaryReader');
goog.require('jspb.Map');
diff --git a/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/text_format_test.py b/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/text_format_test.py
index bc53e25..1e6f063 100755
--- a/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/text_format_test.py
+++ b/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/text_format_test.py
@@ -248,7 +248,7 @@
.replace('e-0','e-').replace('e-0','e-')
# Floating point fields are printed with .0 suffix even if they are
# actualy integer numbers.
- text = re.compile('\.0$', re.MULTILINE).sub('', text)
+ text = re.compile(r'\.0$', re.MULTILINE).sub('', text)
return text
def testMergeGolden(self):
diff --git a/src/google/protobuf/testing/googletest.cc b/src/google/protobuf/testing/googletest.cc
index 8c89e5a..5c89c0f 100644
--- a/src/google/protobuf/testing/googletest.cc
+++ b/src/google/protobuf/testing/googletest.cc
@@ -86,7 +86,11 @@
// Look for the "src" directory.
string prefix = ".";
- while (!File::Exists(prefix + "/src/google/protobuf")) {
+ // Keep looking further up the directory tree until we find
+ // src/.../descriptor.cc. It is important to look for a particular file,
+ // keeping in mind that with Bazel builds the directory structure under
+ // bazel-bin/ looks similar to the main directory tree in the Git repo.
+ while (!File::Exists(prefix + "/src/google/protobuf/descriptor.cc")) {
if (!File::Exists(prefix)) {
GOOGLE_LOG(FATAL)
<< "Could not find protobuf source code. Please run tests from "