[issue11063] uuid.py module import has heavy side effects

Martin Panter report at bugs.python.org
Sun Apr 24 23:51:23 EDT 2016


Martin Panter added the comment:

One thing I am wondering about is why we have to use find_library() at all. Wouldn’t it be more robust, and more efficient, to call CDLL() directly? We just have to know the exactly library version we are expecting. On Linux, the full soname is libuuid.so.1. It seems on OS X it is called libc.dylib (but it would be good for someone else to confirm).

# The uuid_generate_* routines are provided by libuuid on at least
# Linux and FreeBSD, and provided by libc on Mac OS X.
if sys.platform == "darwin":
    libname = "libc.dylib"
else:
    libname = "libuuid.so.1"
_ctypes_lib = ctypes.CDLL(libname)

----------
nosy: +martin.panter

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11063>
_______________________________________


More information about the Python-bugs-list mailing list