Hm, I had interpreted the Python documentation differently, by analogy with PyModule_AddIntConstant. I also tested but couldn't force a GC error. This is what I just tried:
>>> import zookeeper
>>> import gc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
zookeeper.ZooKeeperException: zhandle out of range
I also tried removing the reference from the module before doing the gc, via del zookeeper.ZooKeeperException.
However, I think you're right, by looking at other usage examples. I think it's acceptable to take the examples in the Python manual as canonical, so I support reinstating that line.
The patch is simple, but I'm not sure how best to test it. Perhaps forcing an exception pointer to NULL via a C module call, but then that would pollute the object's namespace. A test module that wasn't shipped, but built for testing?