anmolnar commented on code in PR #2199: URL: https://github.com/apache/zookeeper/pull/2199#discussion_r1794279440
########## zookeeper-contrib/zookeeper-contrib-zkpython/src/c/zookeeper.c: ########## @@ -1477,8 +1491,11 @@ PyObject *pyzoo_set_log_stream(PyObject *self, PyObject *args) } #if PY_MAJOR_VERSION >= 3 - extern PyTypeObject PyIOBase_Type; - if (!PyObject_IsInstance(pystream, (PyObject *)&PyIOBase_Type)) { + if (init_file_emulator() < 0) { + return NULL; + } Review Comment: I'm not sure about it's at the right place. Init should only be called once, but now it will be called every time somebody sets the log stream, which usually happens once, still must be a better place for this. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@zookeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org