On OS X, use os.uname() instead of gestalt.sysv(...) to get the
operating system version. This allows to use ctypes when Python was configured with --disable-toolbox-glue.
This commit is contained in:
parent
631fee6235
commit
7fee6dd2a3
|
@ -24,19 +24,12 @@ if _os.name in ("nt", "ce"):
|
|||
|
||||
DEFAULT_MODE = RTLD_LOCAL
|
||||
if _os.name == "posix" and _sys.platform == "darwin":
|
||||
import gestalt
|
||||
|
||||
# gestalt.gestalt("sysv") returns the version number of the
|
||||
# currently active system file as BCD.
|
||||
# On OS X 10.4.6 -> 0x1046
|
||||
# On OS X 10.2.8 -> 0x1028
|
||||
# See also http://www.rgaros.nl/gestalt/
|
||||
#
|
||||
# On OS X 10.3, we use RTLD_GLOBAL as default mode
|
||||
# because RTLD_LOCAL does not work at least on some
|
||||
# libraries.
|
||||
# libraries. OS X 10.3 is Darwin 7, so we check for
|
||||
# that.
|
||||
|
||||
if gestalt.gestalt("sysv") < 0x1040:
|
||||
if int(_os.uname()[2].split('.')[0]) < 8:
|
||||
DEFAULT_MODE = RTLD_GLOBAL
|
||||
|
||||
from _ctypes import FUNCFLAG_CDECL as _FUNCFLAG_CDECL, \
|
||||
|
|
Loading…
Reference in New Issue