Commit 99c1ddc7 authored by Wouter van Oortmerssen's avatar Wouter van Oortmerssen

Merge branch 'master' of https://github.com/google/flatbuffers

parents 69eef0a0 42bd6447
...@@ -26,8 +26,7 @@ your program by including the header. As noted, this header relies on ...@@ -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 The code for the FlatBuffers C++ library can be found at
`flatbuffers/include/flatbuffers`. You can browse the library code on the `flatbuffers/include/flatbuffers`. You can browse the library code on the
[FlatBuffers GitHub page](https://github.com/google/flatbuffers/tree/master/ [FlatBuffers GitHub page](https://github.com/google/flatbuffers/tree/master/include/flatbuffers).
include/flatbuffers).
## Testing the FlatBuffers C++ library ## Testing the FlatBuffers C++ library
......
...@@ -401,7 +401,7 @@ class Builder(object): ...@@ -401,7 +401,7 @@ class Builder(object):
if isinstance(s, compat.string_types): if isinstance(s, compat.string_types):
x = s.encode(encoding, errors) x = s.encode(encoding, errors)
elif isinstance(s, compat.binary_type): elif isinstance(s, compat.binary_types):
x = s x = s
else: else:
raise TypeError("non-string passed to CreateString") raise TypeError("non-string passed to CreateString")
......
...@@ -11,13 +11,16 @@ PY34 = sys.version_info[0:2] >= (3, 4) ...@@ -11,13 +11,16 @@ PY34 = sys.version_info[0:2] >= (3, 4)
if PY3: if PY3:
string_types = (str,) string_types = (str,)
binary_type = bytes binary_types = (bytes,bytearray)
range_func = range range_func = range
memoryview_type = memoryview memoryview_type = memoryview
struct_bool_decl = "?" struct_bool_decl = "?"
else: else:
string_types = (basestring,) string_types = (unicode,)
binary_type = str if PY26 or PY27:
binary_types = (str,bytearray)
else:
binary_types = (str,)
range_func = xrange range_func = xrange
if PY26 or (PY27 and not PY275): if PY26 or (PY27 and not PY275):
memoryview_type = buffer memoryview_type = buffer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment