Hey Chris, I fixed the problem in another way (don't ask me why that works). One detail I didn't talk about is that I use the Boost.Python library. So I just made sure that I load the socket module before I import my own Python script (using that socket module):
... object main_module((handle<>(borrowed(PyImport_AddModule("__main__"))))); object socket_module((handle<>(borrowed(PyImport_AddModule("socket"))))); object main_namespace = main_module.attr("__dict__"); handle<> result((allow_null(PyRun_String("...", Py_file_input, main_namespace.ptr(), main_namespace.ptr())))); ... Maybe someone can shed some light on what's going on here but for the moment I'm happy that it works at all !!! Cheers, Jan -- http://mail.python.org/mailman/listinfo/python-list