summaryrefslogtreecommitdiff
path: root/Lib/ctypes
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2016-09-05 15:11:23 -0700
committerLarry Hastings <larry@hastings.org>2016-09-05 15:11:23 -0700
commitbb0ec1fc07628252f17d66a58a4a4b3654e571c3 (patch)
treeb270fab5c2e6371e1f73346e79fdd046f93598de /Lib/ctypes
parenteef0808012356b625e5a55dd635378b18f6c200c (diff)
downloadcpython-bb0ec1fc07628252f17d66a58a4a4b3654e571c3.tar.gz
Issue #27355: Removed support for Windows CE. It was never finished,
and Windows CE is no longer a relevant platform for Python.
Diffstat (limited to 'Lib/ctypes')
-rw-r--r--Lib/ctypes/__init__.py17
-rw-r--r--Lib/ctypes/test/test_bitfields.py4
-rw-r--r--Lib/ctypes/test/test_funcptr.py2
-rw-r--r--Lib/ctypes/test/test_loading.py17
-rw-r--r--Lib/ctypes/util.py10
5 files changed, 15 insertions, 35 deletions
diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py
index 0d860784bc..1c9d3a525b 100644
--- a/Lib/ctypes/__init__.py
+++ b/Lib/ctypes/__init__.py
@@ -16,7 +16,7 @@ from struct import calcsize as _calcsize
if __version__ != _ctypes_version:
raise Exception("Version number mismatch", __version__, _ctypes_version)
-if _os.name in ("nt", "ce"):
+if _os.name == "nt":
from _ctypes import FormatError
DEFAULT_MODE = RTLD_LOCAL
@@ -103,12 +103,9 @@ def CFUNCTYPE(restype, *argtypes, **kw):
_c_functype_cache[(restype, argtypes, flags)] = CFunctionType
return CFunctionType
-if _os.name in ("nt", "ce"):
+if _os.name == "nt":
from _ctypes import LoadLibrary as _dlopen
from _ctypes import FUNCFLAG_STDCALL as _FUNCFLAG_STDCALL
- if _os.name == "ce":
- # 'ce' doesn't have the stdcall calling convention
- _FUNCFLAG_STDCALL = _FUNCFLAG_CDECL
_win_functype_cache = {}
def WINFUNCTYPE(restype, *argtypes, **kw):
@@ -262,7 +259,7 @@ class c_wchar(_SimpleCData):
def _reset_cache():
_pointer_type_cache.clear()
_c_functype_cache.clear()
- if _os.name in ("nt", "ce"):
+ if _os.name == "nt":
_win_functype_cache.clear()
# _SimpleCData.c_wchar_p_from_param
POINTER(c_wchar).from_param = c_wchar_p.from_param
@@ -374,7 +371,7 @@ class PyDLL(CDLL):
"""
_func_flags_ = _FUNCFLAG_CDECL | _FUNCFLAG_PYTHONAPI
-if _os.name in ("nt", "ce"):
+if _os.name == "nt":
class WinDLL(CDLL):
"""This class represents a dll exporting functions using the
@@ -427,7 +424,7 @@ class LibraryLoader(object):
cdll = LibraryLoader(CDLL)
pydll = LibraryLoader(PyDLL)
-if _os.name in ("nt", "ce"):
+if _os.name == "nt":
pythonapi = PyDLL("python dll", None, _sys.dllhandle)
elif _sys.platform == "cygwin":
pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2])
@@ -435,7 +432,7 @@ else:
pythonapi = PyDLL(None)
-if _os.name in ("nt", "ce"):
+if _os.name == "nt":
windll = LibraryLoader(WinDLL)
oledll = LibraryLoader(OleDLL)
@@ -503,7 +500,7 @@ else:
return _wstring_at(ptr, size)
-if _os.name in ("nt", "ce"): # COM stuff
+if _os.name == "nt": # COM stuff
def DllGetClassObject(rclsid, riid, ppv):
try:
ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*'])
diff --git a/Lib/ctypes/test/test_bitfields.py b/Lib/ctypes/test/test_bitfields.py
index 0eb09fb4bf..c71d71de69 100644
--- a/Lib/ctypes/test/test_bitfields.py
+++ b/Lib/ctypes/test/test_bitfields.py
@@ -196,7 +196,7 @@ class BitFieldTest(unittest.TestCase):
class X(Structure):
_fields_ = [("a", c_byte, 4),
("b", c_int, 4)]
- if os.name in ("nt", "ce"):
+ if os.name == "nt":
self.assertEqual(sizeof(X), sizeof(c_int)*2)
else:
self.assertEqual(sizeof(X), sizeof(c_int))
@@ -224,7 +224,7 @@ class BitFieldTest(unittest.TestCase):
# MSVC does NOT combine c_short and c_int into one field, GCC
# does (unless GCC is run with '-mms-bitfields' which
# produces code compatible with MSVC).
- if os.name in ("nt", "ce"):
+ if os.name == "nt":
self.assertEqual(sizeof(X), sizeof(c_int) * 4)
else:
self.assertEqual(sizeof(X), sizeof(c_int) * 2)
diff --git a/Lib/ctypes/test/test_funcptr.py b/Lib/ctypes/test/test_funcptr.py
index ff25c8febd..636c045c9e 100644
--- a/Lib/ctypes/test/test_funcptr.py
+++ b/Lib/ctypes/test/test_funcptr.py
@@ -39,7 +39,7 @@ class CFuncPtrTestCase(unittest.TestCase):
# possible, as in C, to call cdecl functions with more parameters.
#self.assertRaises(TypeError, c, 1, 2, 3)
self.assertEqual(c(1, 2, 3, 4, 5, 6), 3)
- if not WINFUNCTYPE is CFUNCTYPE and os.name != "ce":
+ if not WINFUNCTYPE is CFUNCTYPE:
self.assertRaises(TypeError, s, 1, 2, 3)
def test_structures(self):
diff --git a/Lib/ctypes/test/test_loading.py b/Lib/ctypes/test/test_loading.py
index 28468c1cd3..45571f3d3d 100644
--- a/Lib/ctypes/test/test_loading.py
+++ b/Lib/ctypes/test/test_loading.py
@@ -11,8 +11,6 @@ def setUpModule():
global libc_name
if os.name == "nt":
libc_name = find_library("c")
- elif os.name == "ce":
- libc_name = "coredll"
elif sys.platform == "cygwin":
libc_name = "cygwin1.dll"
else:
@@ -49,8 +47,8 @@ class LoaderTest(unittest.TestCase):
cdll.LoadLibrary(lib)
CDLL(lib)
- @unittest.skipUnless(os.name in ("nt", "ce"),
- 'test specific to Windows (NT/CE)')
+ @unittest.skipUnless(os.name == "nt",
+ 'test specific to Windows')
def test_load_library(self):
# CRT is no longer directly loadable. See issue23606 for the
# discussion about alternative approaches.
@@ -64,14 +62,9 @@ class LoaderTest(unittest.TestCase):
windll["kernel32"].GetModuleHandleW
windll.LoadLibrary("kernel32").GetModuleHandleW
WinDLL("kernel32").GetModuleHandleW
- elif os.name == "ce":
- windll.coredll.GetModuleHandleW
- windll["coredll"].GetModuleHandleW
- windll.LoadLibrary("coredll").GetModuleHandleW
- WinDLL("coredll").GetModuleHandleW
-
- @unittest.skipUnless(os.name in ("nt", "ce"),
- 'test specific to Windows (NT/CE)')
+
+ @unittest.skipUnless(os.name == "nt",
+ 'test specific to Windows')
def test_load_ordinal_functions(self):
import _ctypes_test
dll = WinDLL(_ctypes_test.__file__)
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index f5c6b266b6..339ae8aa8a 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -67,16 +67,6 @@ if os.name == "nt":
return fname
return None
-if os.name == "ce":
- # search path according to MSDN:
- # - absolute path specified by filename
- # - The .exe launch directory
- # - the Windows directory
- # - ROM dll files (where are they?)
- # - OEM specified search path: HKLM\Loader\SystemPath
- def find_library(name):
- return name
-
if os.name == "posix" and sys.platform == "darwin":
from ctypes.macholib.dyld import dyld_find as _dyld_find
def find_library(name):