Commit 77831c07 authored by Joshua Haberman's avatar Joshua Haberman

Merge pull request #1081 from haberman/fix-py3

Fixes for Python 3.
parents d5fb408d e1abdf2c
...@@ -111,8 +111,16 @@ struct MessageMapContainer : public MapContainer { ...@@ -111,8 +111,16 @@ struct MessageMapContainer : public MapContainer {
PyObject* message_dict; PyObject* message_dict;
}; };
extern PyTypeObject ScalarMapContainer_Type; #if PY_MAJOR_VERSION >= 3
extern PyTypeObject MessageMapContainer_Type; extern PyObject *MessageMapContainer_Type;
extern PyType_Spec MessageMapContainer_Type_spec;
extern PyObject *ScalarMapContainer_Type;
extern PyType_Spec ScalarMapContainer_Type_spec;
#else
extern PyTypeObject MessageMapContainer_Type;
extern PyTypeObject ScalarMapContainer_Type;
#endif
extern PyTypeObject MapIterator_Type; // Both map types use the same iterator. extern PyTypeObject MapIterator_Type; // Both map types use the same iterator.
// Builds a MapContainer object, from a parent message and a // Builds a MapContainer object, from a parent message and a
......
...@@ -162,7 +162,7 @@ if __name__ == '__main__': ...@@ -162,7 +162,7 @@ if __name__ == '__main__':
extra_compile_args = ['-Wno-write-strings', '-Wno-invalid-offsetof'] extra_compile_args = ['-Wno-write-strings', '-Wno-invalid-offsetof']
test_conformance.target = 'test_python_cpp' test_conformance.target = 'test_python_cpp'
if "clang" in os.popen('$CC --version').read(): if "clang" in os.popen('$CC --version 2> /dev/null').read():
extra_compile_args.append('-Wno-shorten-64-to-32') extra_compile_args.append('-Wno-shorten-64-to-32')
if warnings_as_errors in sys.argv: if warnings_as_errors in sys.argv:
......
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