aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-04-01 07:16:10 +0300
committerMatti Picus <matti.picus@gmail.com>2020-04-01 07:16:10 +0300
commit1a92e4a590405a63d3ca079a7f859bd6fb002c2b (patch)
tree729c3e420f5c62687cc22a371bf8e82ab8306f49
parentdebug_start/debug_stop uses time.clock, use that in test as well (diff)
downloadpypy-1a92e4a590405a63d3ca079a7f859bd6fb002c2b.tar.gz
pypy-1a92e4a590405a63d3ca079a7f859bd6fb002c2b.tar.bz2
pypy-1a92e4a590405a63d3ca079a7f859bd6fb002c2b.zip
backport parts of ctypes.util for msvc>13 (may require adjustment of cffi tests)
-rw-r--r--lib-python/2.7/ctypes/util.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/lib-python/2.7/ctypes/util.py b/lib-python/2.7/ctypes/util.py
index 16930e4528..ccfdfba965 100644
--- a/lib-python/2.7/ctypes/util.py
+++ b/lib-python/2.7/ctypes/util.py
@@ -19,6 +19,8 @@ if os.name == "nt":
i = i + len(prefix)
s, rest = sys.version[i:].split(" ", 1)
majorVersion = int(s[:-2]) - 6
+ if majorVersion >= 13:
+ majorVersion += 1
minorVersion = int(s[2:3]) / 10.0
# I don't think paths are affected by minor version in version 6
if majorVersion == 6:
@@ -36,8 +38,12 @@ if os.name == "nt":
return None
if version <= 6:
clibname = 'msvcrt'
- else:
+ elif version <= 13:
clibname = 'msvcr%d' % (version * 10)
+ else:
+ # CRT is no longer directly loadable. See issue23606 for the
+ # discussion about alternative approaches.
+ return None
# If python was built with in debug mode
import imp
@@ -60,16 +66,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":
def find_library(name):
from ctypes.macholib.dyld import dyld_find as _dyld_find