summaryrefslogtreecommitdiffstats
path: root/Lib/ctypes
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2006-04-06 15:23:16 (GMT)
committerThomas Heller <theller@ctypes.org>2006-04-06 15:23:16 (GMT)
commitfff61ea025e9ef31a2a467e685cbda3277d5237f (patch)
tree1bcaa7f235b0bb72f166ba0c906528ed23fe6d1c /Lib/ctypes
parenta4d651fbc8055a59a20e52ddc745a511a1c0b431 (diff)
downloadcpython-fff61ea025e9ef31a2a467e685cbda3277d5237f.zip
cpython-fff61ea025e9ef31a2a467e685cbda3277d5237f.tar.gz
cpython-fff61ea025e9ef31a2a467e685cbda3277d5237f.tar.bz2
Expose RTLD_LOCAL and RTLD_GLOBAL always from the _ctypes extension module.
If RTLD_LOCAL is not #defined in any header file (Windows), set it to 0. If RTLD_GLOBAL is not #defined, set it equal to RTLD_LOCAL. This should fix ctypes on cygwin.
Diffstat (limited to 'Lib/ctypes')
-rw-r--r--Lib/ctypes/__init__.py6
-rw-r--r--Lib/ctypes/_loader.py7
2 files changed, 3 insertions, 10 deletions
diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py
index a005594..28ac180 100644
--- a/Lib/ctypes/__init__.py
+++ b/Lib/ctypes/__init__.py
@@ -9,11 +9,7 @@ from _ctypes import Union, Structure, Array
from _ctypes import _Pointer
from _ctypes import CFuncPtr as _CFuncPtr
from _ctypes import __version__ as _ctypes_version
-try:
- from _ctypes import RTLD_LOCAL, RTLD_GLOBAL
-except (ImportError, AttributeError):
- RTLD_GLOBAL = RTLD_LOCAL = None
-
+from _ctypes import RTLD_LOCAL, RTLD_GLOBAL
from _ctypes import ArgumentError
from struct import calcsize as _calcsize
diff --git a/Lib/ctypes/_loader.py b/Lib/ctypes/_loader.py
index 6ab0296..7a48c1c 100644
--- a/Lib/ctypes/_loader.py
+++ b/Lib/ctypes/_loader.py
@@ -1,14 +1,11 @@
-# WORK IN PROGRESS! DO NOT (yet) USE!
import sys, os
import ctypes
-__all__ = ["LibraryLoader", "RTLD_LOCAL", "RTLD_GLOBAL"]
-
if os.name in ("nt", "ce"):
from _ctypes import LoadLibrary as dlopen
- RTLD_LOCAL = RTLD_GLOBAL = None
else:
- from _ctypes import dlopen, RTLD_LOCAL, RTLD_GLOBAL
+ from _ctypes import dlopen
+from _ctypes import RTLD_LOCAL, RTLD_GLOBAL
# _findLib(name) returns an iterable of possible names for a library.
if os.name in ("nt", "ce"):