Thrift: Handle absence of fastbinary.so
authorDavid Reiss <dreiss@apache.org>
Thu, 30 Aug 2007 23:07:45 +0000 (23:07 +0000)
committerDavid Reiss <dreiss@apache.org>
Thu, 30 Aug 2007 23:07:45 +0000 (23:07 +0000)
commit5db3e926713d6fba0e9d0348d29b58bb8ec29367
treea24e82eff20d5af03d9b45174c72e3a26a346124
parent792df0bf78d061ede0af7f12bf92c72254ed12d8
Thrift: Handle absence of fastbinary.so

Summary:
- Wrap import of fastbinary in a try/catch, setting it to None if it fails.
- Don't try to fastbinary.encode/decode if fastbinary is None.
- Always generate thrift_spec, even if it is None.
- Don't try to fastbinary.encode/decode if thrift_spec is None.

Reviewed By: mcslee

Test Plan:
test/py/Test{Client,Server}.py
Manually delete my fastbinary.so, they worked fine.
Changed them to use Accelerated protocol.  They still worked fine because
the test falls through to the normal generated code.
Installed fastbinary.so, everything worked fine (eventually).

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665236 13f79535-47bb-0310-9956-ffa450edef68
compiler/cpp/src/generate/t_py_generator.cc
compiler/cpp/src/generate/t_py_generator.h
lib/py/src/protocol/TBinaryProtocol.py
lib/py/src/reflection/limited/ttypes.py