mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Remove the last use of win32process
This commit is contained in:
parent
32bbcd092d
commit
56b1554c1e
@ -180,19 +180,17 @@ def print_basic_debug_info(out=None):
|
||||
out = sys.stdout
|
||||
out = functools.partial(prints, file=out)
|
||||
import platform
|
||||
from contextlib import suppress
|
||||
from calibre.constants import (__appname__, get_version, isportable, ismacos,
|
||||
isfrozen, is64bit)
|
||||
isfrozen, is64bit, plugins)
|
||||
from calibre.utils.localization import set_translators
|
||||
out(__appname__, get_version(), 'Portable' if isportable else '',
|
||||
'embedded-python:', isfrozen, 'is64bit:', is64bit)
|
||||
out(platform.platform(), platform.system(), platform.architecture())
|
||||
if iswindows and not is64bit:
|
||||
try:
|
||||
import win32process
|
||||
if win32process.IsWow64Process():
|
||||
with suppress(Exception):
|
||||
if plugins['winutil'][0].is_wow64_process():
|
||||
out('32bit process running on 64bit windows')
|
||||
except:
|
||||
pass
|
||||
out(platform.system_alias(platform.system(), platform.release(),
|
||||
platform.version()))
|
||||
out('Python', platform.python_version())
|
||||
|
@ -835,6 +835,13 @@ run_cmdline(PyObject *self, PyObject *args) {
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
is_wow64_process(PyObject *self, PyObject *args) {
|
||||
BOOL ans;
|
||||
if (!IsWow64Process(GetCurrentProcess(), &ans)) return PyErr_SetFromWindowsErr(0);
|
||||
return Py_BuildValue("O", ans ? Py_True : Py_False);
|
||||
}
|
||||
|
||||
// Icon loading {{{
|
||||
#pragma pack( push )
|
||||
#pragma pack( 2 )
|
||||
@ -969,6 +976,7 @@ static const char winutil_doc[] = "Defines utility methods to interface with win
|
||||
#define M(name, args) { #name, name, args, ""}
|
||||
static PyMethodDef winutil_methods[] = {
|
||||
M(run_cmdline, METH_VARARGS),
|
||||
M(is_wow64_process, METH_NOARGS),
|
||||
M(get_dll_directory, METH_NOARGS),
|
||||
M(create_mutex, METH_VARARGS),
|
||||
M(get_async_key_state, METH_VARARGS),
|
||||
|
Loading…
x
Reference in New Issue
Block a user