| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8c21ab0 commit 10108a7
27 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -57,7 +57,7 @@ Notes on the availability of these functions: | |||
| 57 | 57 | ||
| 58 | 58 | The name of the operating system dependent module imported. The following | |
| 59 | 59 | names have currently been registered: ``'posix'``, ``'nt'``, | |
| 60 | - ``'ce'``, ``'java'``. | ||
| 60 | + ``'java'``. | ||
| 61 | 61 | ||
| 62 | 62 | .. seealso:: | |
| 63 | 63 | :attr:`sys.platform` has a finer granularity. :func:`os.uname` gives | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ These modules are used to implement the :mod:`os.path` module, and are not | |||
| 20 | 20 | documented beyond this mention. There's little need to document these. | |
| 21 | 21 | ||
| 22 | 22 | :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. | ||
| 24 | 24 | ||
| 25 | 25 | :mod:`posixpath` | |
| 26 | 26 | --- Implementation of :mod:`os.path` on POSIX. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -333,7 +333,7 @@ def connect(self, address): | |||
| 333 | 333 | self.connecting = True | |
| 334 | 334 | err = self.socket.connect_ex(address) | |
| 335 | 335 | if err in (EINPROGRESS, EALREADY, EWOULDBLOCK) \ | |
| 336 | - or err == EINVAL and os.name in ('nt', 'ce'): | ||
| 336 | + or err == EINVAL and os.name == 'nt': | ||
| 337 | 337 | self.addr = address | |
| 338 | 338 | return | |
| 339 | 339 | if err in (0, EISCONN): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ | |||
| 16 | 16 | if __version__ != _ctypes_version: | |
| 17 | 17 | raise Exception("Version number mismatch", __version__, _ctypes_version) | |
| 18 | 18 | ||
| 19 | - if _os.name in ("nt", "ce"): | ||
| 19 | + if _os.name == "nt": | ||
| 20 | 20 | from _ctypes import FormatError | |
| 21 | 21 | ||
| 22 | 22 | DEFAULT_MODE = RTLD_LOCAL | |
@@ -103,12 +103,9 @@ class CFunctionType(_CFuncPtr): | |||
| 103 | 103 | _c_functype_cache[(restype, argtypes, flags)] = CFunctionType | |
| 104 | 104 | return CFunctionType | |
| 105 | 105 | ||
| 106 | - if _os.name in ("nt", "ce"): | ||
| 106 | + if _os.name == "nt": | ||
| 107 | 107 | from _ctypes import LoadLibrary as _dlopen | |
| 108 | 108 | 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 | ||
| 112 | 109 | ||
| 113 | 110 | _win_functype_cache = {} | |
| 114 | 111 | def WINFUNCTYPE(restype, *argtypes, **kw): | |
@@ -262,7 +259,7 @@ class c_wchar(_SimpleCData): | |||
| 262 | 259 | def _reset_cache(): | |
| 263 | 260 | _pointer_type_cache.clear() | |
| 264 | 261 | _c_functype_cache.clear() | |
| 265 | - if _os.name in ("nt", "ce"): | ||
| 262 | + if _os.name == "nt": | ||
| 266 | 263 | _win_functype_cache.clear() | |
| 267 | 264 | # _SimpleCData.c_wchar_p_from_param | |
| 268 | 265 | POINTER(c_wchar).from_param = c_wchar_p.from_param | |
@@ -374,7 +371,7 @@ class PyDLL(CDLL): | |||
| 374 | 371 | """ | |
| 375 | 372 | _func_flags_ = _FUNCFLAG_CDECL | _FUNCFLAG_PYTHONAPI | |
| 376 | 373 | ||
| 377 | - if _os.name in ("nt", "ce"): | ||
| 374 | + if _os.name == "nt": | ||
| 378 | 375 | ||
| 379 | 376 | class WinDLL(CDLL): | |
| 380 | 377 | """This class represents a dll exporting functions using the | |
@@ -427,15 +424,15 @@ def LoadLibrary(self, name): | |||
| 427 | 424 | cdll = LibraryLoader(CDLL) | |
| 428 | 425 | pydll = LibraryLoader(PyDLL) | |
| 429 | 426 | ||
| 430 | - if _os.name in ("nt", "ce"): | ||
| 427 | + if _os.name == "nt": | ||
| 431 | 428 | pythonapi = PyDLL("python dll", None, _sys.dllhandle) | |
| 432 | 429 | elif _sys.platform == "cygwin": | |
| 433 | 430 | pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2]) | |
| 434 | 431 | else: | |
| 435 | 432 | pythonapi = PyDLL(None) | |
| 436 | 433 | ||
| 437 | 434 | ||
| 438 | - if _os.name in ("nt", "ce"): | ||
| 435 | + if _os.name == "nt": | ||
| 439 | 436 | windll = LibraryLoader(WinDLL) | |
| 440 | 437 | oledll = LibraryLoader(OleDLL) | |
| 441 | 438 | ||
@@ -503,7 +500,7 @@ def wstring_at(ptr, size=-1): | |||
| 503 | 500 | return _wstring_at(ptr, size) | |
| 504 | 501 | ||
| 505 | 502 | ||
| 506 | - if _os.name in ("nt", "ce"): # COM stuff | ||
| 503 | + if _os.name == "nt": # COM stuff | ||
| 507 | 504 | def DllGetClassObject(rclsid, riid, ppv): | |
| 508 | 505 | try: | |
| 509 | 506 | ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*']) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -196,7 +196,7 @@ def test_mixed_1(self): | |||
| 196 | 196 | class X(Structure): | |
| 197 | 197 | _fields_ = [("a", c_byte, 4), | |
| 198 | 198 | ("b", c_int, 4)] | |
| 199 | - if os.name in ("nt", "ce"): | ||
| 199 | + if os.name == "nt": | ||
| 200 | 200 | self.assertEqual(sizeof(X), sizeof(c_int)*2) | |
| 201 | 201 | else: | |
| 202 | 202 | self.assertEqual(sizeof(X), sizeof(c_int)) | |
@@ -224,7 +224,7 @@ class X(Structure): | |||
| 224 | 224 | # MSVC does NOT combine c_short and c_int into one field, GCC | |
| 225 | 225 | # does (unless GCC is run with '-mms-bitfields' which | |
| 226 | 226 | # produces code compatible with MSVC). | |
| 227 | - if os.name in ("nt", "ce"): | ||
| 227 | + if os.name == "nt": | ||
| 228 | 228 | self.assertEqual(sizeof(X), sizeof(c_int) * 4) | |
| 229 | 229 | else: | |
| 230 | 230 | self.assertEqual(sizeof(X), sizeof(c_int) * 2) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,7 +39,7 @@ def func(a, b): | |||
| 39 | 39 | # possible, as in C, to call cdecl functions with more parameters. | |
| 40 | 40 | #self.assertRaises(TypeError, c, 1, 2, 3) | |
| 41 | 41 | 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: | ||
| 43 | 43 | self.assertRaises(TypeError, s, 1, 2, 3) | |
| 44 | 44 | ||
| 45 | 45 | def test_structures(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,8 +11,6 @@ def setUpModule(): | |||
| 11 | 11 | global libc_name | |
| 12 | 12 | if os.name == "nt": | |
| 13 | 13 | libc_name = find_library("c") | |
| 14 | - elif os.name == "ce": | ||
| 15 | - libc_name = "coredll" | ||
| 16 | 14 | elif sys.platform == "cygwin": | |
| 17 | 15 | libc_name = "cygwin1.dll" | |
| 18 | 16 | else: | |
@@ -49,8 +47,8 @@ def test_find(self): | |||
| 49 | 47 | cdll.LoadLibrary(lib) | |
| 50 | 48 | CDLL(lib) | |
| 51 | 49 | ||
| 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') | ||
| 54 | 52 | def test_load_library(self): | |
| 55 | 53 | # CRT is no longer directly loadable. See issue23606 for the | |
| 56 | 54 | # discussion about alternative approaches. | |
@@ -64,14 +62,9 @@ def test_load_library(self): | |||
| 64 | 62 | windll["kernel32"].GetModuleHandleW | |
| 65 | 63 | windll.LoadLibrary("kernel32").GetModuleHandleW | |
| 66 | 64 | 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') | ||
| 75 | 68 | def test_load_ordinal_functions(self): | |
| 76 | 69 | import _ctypes_test | |
| 77 | 70 | dll = WinDLL(_ctypes_test.__file__) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -67,16 +67,6 @@ def find_library(name): | |||
| 67 | 67 | return fname | |
| 68 | 68 | return None | |
| 69 | 69 | ||
| 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 | - | ||
| 80 | 70 | if os.name == "posix" and sys.platform == "darwin": | |
| 81 | 71 | from ctypes.macholib.dyld import dyld_find as _dyld_find | |
| 82 | 72 | def find_library(name): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,8 +28,6 @@ | |||
| 28 | 28 | pathsep = ';' | |
| 29 | 29 | altsep = '/' | |
| 30 | 30 | defpath = '.;C:\\bin' | |
| 31 | - if 'ce' in sys.builtin_module_names: | ||
| 32 | - defpath = '\\Windows' | ||
| 33 | 31 | devnull = 'nul' | |
| 34 | 32 | ||
| 35 | 33 | def _get_bothseps(path): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,9 +1,9 @@ | |||
| 1 | 1 | r"""OS routines for NT or Posix depending on what system we're on. | |
| 2 | 2 | ||
| 3 | 3 | 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. | ||
| 5 | 5 | - os.path is either posixpath or ntpath | |
| 6 | - - os.name is either 'posix', 'nt' or 'ce'. | ||
| 6 | + - os.name is either 'posix' or 'nt' | ||
| 7 | 7 | - os.curdir is a string representing the current directory ('.' or ':') | |
| 8 | 8 | - os.pardir is a string representing the parent directory ('..' or '::') | |
| 9 | 9 | - os.sep is the (or a most common) pathname separator ('/' or ':' or '\\') | |
@@ -85,27 +85,6 @@ def _get_exports_list(module): | |||
| 85 | 85 | except ImportError: | |
| 86 | 86 | pass | |
| 87 | 87 | ||
| 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 | - | ||
| 109 | 88 | else: | |
| 110 | 89 | raise ImportError('no os specific module found') | |
| 111 | 90 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments