mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use find_msvcrt() to load the CRT instead of globbing
This commit is contained in:
parent
96e743c5b1
commit
0ba86c31f4
@ -274,6 +274,12 @@ def test_openssl():
|
|||||||
raise ValueError('Mozilla CA certs not loaded')
|
raise ValueError('Mozilla CA certs not loaded')
|
||||||
fprint('SSL OK!')
|
fprint('SSL OK!')
|
||||||
|
|
||||||
|
def test_crt():
|
||||||
|
from ctypes.util import find_msvcrt
|
||||||
|
if not find_msvcrt():
|
||||||
|
raise SystemExit('find_msvcrt() failed')
|
||||||
|
fprint('CRT OK!')
|
||||||
|
|
||||||
def test():
|
def test():
|
||||||
if iswindows:
|
if iswindows:
|
||||||
test_dlls()
|
test_dlls()
|
||||||
@ -305,6 +311,7 @@ def test():
|
|||||||
test_wpd()
|
test_wpd()
|
||||||
test_winutil()
|
test_winutil()
|
||||||
test_file_dialog_helper()
|
test_file_dialog_helper()
|
||||||
|
test_crt()
|
||||||
else:
|
else:
|
||||||
test_terminal()
|
test_terminal()
|
||||||
if isosx:
|
if isosx:
|
||||||
|
@ -158,9 +158,9 @@ def crt():
|
|||||||
# We use the C runtime bundled with the calibre windows build
|
# We use the C runtime bundled with the calibre windows build
|
||||||
global _crt
|
global _crt
|
||||||
if _crt is None:
|
if _crt is None:
|
||||||
import glob, ctypes
|
import ctypes
|
||||||
d = os.path.join(os.path.dirname(sys.executable), '*.CRT', 'msvcr*.dll')
|
from ctypes.util import find_msvcrt
|
||||||
_crt = ctypes.CDLL(glob.glob(d)[0])
|
_crt = ctypes.CDLL(find_msvcrt())
|
||||||
return _crt
|
return _crt
|
||||||
|
|
||||||
class ColoredStream(Detect):
|
class ColoredStream(Detect):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user