I would expect that error if you pull the latest Python code from GitHub master but don’t rebuild the C extension. If you’re building from source, make sure you rebuild the C extension:
python setup.py clean
python setup.py install

(or substitute “build develop” for “install”)