diff --git a/docs/source/CppUsage.md b/docs/source/CppUsage.md index 8c7f6a7d4..d4abe66e4 100755 --- a/docs/source/CppUsage.md +++ b/docs/source/CppUsage.md @@ -26,8 +26,7 @@ your program by including the header. As noted, this header relies on The code for the FlatBuffers C++ library can be found at `flatbuffers/include/flatbuffers`. You can browse the library code on the -[FlatBuffers GitHub page](https://github.com/google/flatbuffers/tree/master/ -include/flatbuffers). +[FlatBuffers GitHub page](https://github.com/google/flatbuffers/tree/master/include/flatbuffers). ## Testing the FlatBuffers C++ library diff --git a/python/flatbuffers/builder.py b/python/flatbuffers/builder.py index 18cfab9c7..552d0e2b7 100644 --- a/python/flatbuffers/builder.py +++ b/python/flatbuffers/builder.py @@ -401,7 +401,7 @@ class Builder(object): if isinstance(s, compat.string_types): x = s.encode(encoding, errors) - elif isinstance(s, compat.binary_type): + elif isinstance(s, compat.binary_types): x = s else: raise TypeError("non-string passed to CreateString") diff --git a/python/flatbuffers/compat.py b/python/flatbuffers/compat.py index 345e38cbf..c592901c0 100644 --- a/python/flatbuffers/compat.py +++ b/python/flatbuffers/compat.py @@ -11,13 +11,16 @@ PY34 = sys.version_info[0:2] >= (3, 4) if PY3: string_types = (str,) - binary_type = bytes + binary_types = (bytes,bytearray) range_func = range memoryview_type = memoryview struct_bool_decl = "?" else: - string_types = (basestring,) - binary_type = str + string_types = (unicode,) + if PY26 or PY27: + binary_types = (str,bytearray) + else: + binary_types = (str,) range_func = xrange if PY26 or (PY27 and not PY275): memoryview_type = buffer