Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 10108a7

Browse files
committed
Issue #27355: Removed support for Windows CE. It was never finished,
and Windows CE is no longer a relevant platform for Python.
1 parent 8c21ab0 commit 10108a7

27 files changed

Lines changed: 29 additions & 1550 deletions

Doc/library/os.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Notes on the availability of these functions:
5757

5858
The name of the operating system dependent module imported. The following
5959
names have currently been registered: ``'posix'``, ``'nt'``,
60-
``'ce'``, ``'java'``.
60+
``'java'``.
6161

6262
.. seealso::
6363
:attr:`sys.platform` has a finer granularity. :func:`os.uname` gives

Doc/library/undoc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ These modules are used to implement the :mod:`os.path` module, and are not
2020
documented beyond this mention. There's little need to document these.
2121

2222
:mod:`ntpath`
23-
--- Implementation of :mod:`os.path` on Win32, Win64, and WinCE platforms.
23+
--- Implementation of :mod:`os.path` on Win32 and Win64 platforms.
2424

2525
:mod:`posixpath`
2626
--- Implementation of :mod:`os.path` on POSIX.

Lib/asyncore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def connect(self, address):
333333
self.connecting = True
334334
err = self.socket.connect_ex(address)
335335
if err in (EINPROGRESS, EALREADY, EWOULDBLOCK) \
336-
or err == EINVAL and os.name in ('nt', 'ce'):
336+
or err == EINVAL and os.name == 'nt':
337337
self.addr = address
338338
return
339339
if err in (0, EISCONN):

Lib/ctypes/__init__.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
if __version__ != _ctypes_version:
1717
raise Exception("Version number mismatch", __version__, _ctypes_version)
1818

19-
if _os.name in ("nt", "ce"):
19+
if _os.name == "nt":
2020
from _ctypes import FormatError
2121

2222
DEFAULT_MODE = RTLD_LOCAL
@@ -103,12 +103,9 @@ class CFunctionType(_CFuncPtr):
103103
_c_functype_cache[(restype, argtypes, flags)] = CFunctionType
104104
return CFunctionType
105105

106-
if _os.name in ("nt", "ce"):
106+
if _os.name == "nt":
107107
from _ctypes import LoadLibrary as _dlopen
108108
from _ctypes import FUNCFLAG_STDCALL as _FUNCFLAG_STDCALL
109-
if _os.name == "ce":
110-
# 'ce' doesn't have the stdcall calling convention
111-
_FUNCFLAG_STDCALL = _FUNCFLAG_CDECL
112109

113110
_win_functype_cache = {}
114111
def WINFUNCTYPE(restype, *argtypes, **kw):
@@ -262,7 +259,7 @@ class c_wchar(_SimpleCData):
262259
def _reset_cache():
263260
_pointer_type_cache.clear()
264261
_c_functype_cache.clear()
265-
if _os.name in ("nt", "ce"):
262+
if _os.name == "nt":
266263
_win_functype_cache.clear()
267264
# _SimpleCData.c_wchar_p_from_param
268265
POINTER(c_wchar).from_param = c_wchar_p.from_param
@@ -374,7 +371,7 @@ class PyDLL(CDLL):
374371
"""
375372
_func_flags_ = _FUNCFLAG_CDECL | _FUNCFLAG_PYTHONAPI
376373

377-
if _os.name in ("nt", "ce"):
374+
if _os.name == "nt":
378375

379376
class WinDLL(CDLL):
380377
"""This class represents a dll exporting functions using the
@@ -427,15 +424,15 @@ def LoadLibrary(self, name):
427424
cdll = LibraryLoader(CDLL)
428425
pydll = LibraryLoader(PyDLL)
429426

430-
if _os.name in ("nt", "ce"):
427+
if _os.name == "nt":
431428
pythonapi = PyDLL("python dll", None, _sys.dllhandle)
432429
elif _sys.platform == "cygwin":
433430
pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2])
434431
else:
435432
pythonapi = PyDLL(None)
436433

437434

438-
if _os.name in ("nt", "ce"):
435+
if _os.name == "nt":
439436
windll = LibraryLoader(WinDLL)
440437
oledll = LibraryLoader(OleDLL)
441438

@@ -503,7 +500,7 @@ def wstring_at(ptr, size=-1):
503500
return _wstring_at(ptr, size)
504501

505502

506-
if _os.name in ("nt", "ce"): # COM stuff
503+
if _os.name == "nt": # COM stuff
507504
def DllGetClassObject(rclsid, riid, ppv):
508505
try:
509506
ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*'])

Lib/ctypes/test/test_bitfields.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def test_mixed_1(self):
196196
class X(Structure):
197197
_fields_ = [("a", c_byte, 4),
198198
("b", c_int, 4)]
199-
if os.name in ("nt", "ce"):
199+
if os.name == "nt":
200200
self.assertEqual(sizeof(X), sizeof(c_int)*2)
201201
else:
202202
self.assertEqual(sizeof(X), sizeof(c_int))
@@ -224,7 +224,7 @@ class X(Structure):
224224
# MSVC does NOT combine c_short and c_int into one field, GCC
225225
# does (unless GCC is run with '-mms-bitfields' which
226226
# produces code compatible with MSVC).
227-
if os.name in ("nt", "ce"):
227+
if os.name == "nt":
228228
self.assertEqual(sizeof(X), sizeof(c_int) * 4)
229229
else:
230230
self.assertEqual(sizeof(X), sizeof(c_int) * 2)

Lib/ctypes/test/test_funcptr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def func(a, b):
3939
# possible, as in C, to call cdecl functions with more parameters.
4040
#self.assertRaises(TypeError, c, 1, 2, 3)
4141
self.assertEqual(c(1, 2, 3, 4, 5, 6), 3)
42-
if not WINFUNCTYPE is CFUNCTYPE and os.name != "ce":
42+
if not WINFUNCTYPE is CFUNCTYPE:
4343
self.assertRaises(TypeError, s, 1, 2, 3)
4444

4545
def test_structures(self):

Lib/ctypes/test/test_loading.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ def setUpModule():
1111
global libc_name
1212
if os.name == "nt":
1313
libc_name = find_library("c")
14-
elif os.name == "ce":
15-
libc_name = "coredll"
1614
elif sys.platform == "cygwin":
1715
libc_name = "cygwin1.dll"
1816
else:
@@ -49,8 +47,8 @@ def test_find(self):
4947
cdll.LoadLibrary(lib)
5048
CDLL(lib)
5149

52-
@unittest.skipUnless(os.name in ("nt", "ce"),
53-
'test specific to Windows (NT/CE)')
50+
@unittest.skipUnless(os.name == "nt",
51+
'test specific to Windows')
5452
def test_load_library(self):
5553
# CRT is no longer directly loadable. See issue23606 for the
5654
# discussion about alternative approaches.
@@ -64,14 +62,9 @@ def test_load_library(self):
6462
windll["kernel32"].GetModuleHandleW
6563
windll.LoadLibrary("kernel32").GetModuleHandleW
6664
WinDLL("kernel32").GetModuleHandleW
67-
elif os.name == "ce":
68-
windll.coredll.GetModuleHandleW
69-
windll["coredll"].GetModuleHandleW
70-
windll.LoadLibrary("coredll").GetModuleHandleW
71-
WinDLL("coredll").GetModuleHandleW
72-
73-
@unittest.skipUnless(os.name in ("nt", "ce"),
74-
'test specific to Windows (NT/CE)')
65+
66+
@unittest.skipUnless(os.name == "nt",
67+
'test specific to Windows')
7568
def test_load_ordinal_functions(self):
7669
import _ctypes_test
7770
dll = WinDLL(_ctypes_test.__file__)

Lib/ctypes/util.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,6 @@ def find_library(name):
6767
return fname
6868
return None
6969

70-
if os.name == "ce":
71-
# search path according to MSDN:
72-
# - absolute path specified by filename
73-
# - The .exe launch directory
74-
# - the Windows directory
75-
# - ROM dll files (where are they?)
76-
# - OEM specified search path: HKLM\Loader\SystemPath
77-
def find_library(name):
78-
return name
79-
8070
if os.name == "posix" and sys.platform == "darwin":
8171
from ctypes.macholib.dyld import dyld_find as _dyld_find
8272
def find_library(name):

Lib/ntpath.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
pathsep = ';'
2929
altsep = '/'
3030
defpath = '.;C:\\bin'
31-
if 'ce' in sys.builtin_module_names:
32-
defpath = '\\Windows'
3331
devnull = 'nul'
3432

3533
def _get_bothseps(path):

Lib/os.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
r"""OS routines for NT or Posix depending on what system we're on.
22
33
This exports:
4-
- all functions from posix, nt or ce, e.g. unlink, stat, etc.
4+
- all functions from posix or nt, e.g. unlink, stat, etc.
55
- os.path is either posixpath or ntpath
6-
- os.name is either 'posix', 'nt' or 'ce'.
6+
- os.name is either 'posix' or 'nt'
77
- os.curdir is a string representing the current directory ('.' or ':')
88
- os.pardir is a string representing the parent directory ('..' or '::')
99
- os.sep is the (or a most common) pathname separator ('/' or ':' or '\\')
@@ -85,27 +85,6 @@ def _get_exports_list(module):
8585
except ImportError:
8686
pass
8787

88-
elif 'ce' in _names:
89-
name = 'ce'
90-
linesep = '\r\n'
91-
from ce import *
92-
try:
93-
from ce import _exit
94-
__all__.append('_exit')
95-
except ImportError:
96-
pass
97-
# We can use the standard Windows path.
98-
import ntpath as path
99-
100-
import ce
101-
__all__.extend(_get_exports_list(ce))
102-
del ce
103-
104-
try:
105-
from ce import _have_functions
106-
except ImportError:
107-
pass
108-
10988
else:
11089
raise ImportError('no os specific module found')
11190

0 commit comments

Comments
 (0)