mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fixes from Pydev.Debugger
This commit is contained in:
@@ -190,12 +190,20 @@ def ismethod(func):
|
||||
args = list(names[:nargs])
|
||||
step = 0
|
||||
|
||||
if not hasattr(func_code, 'CO_VARARGS'):
|
||||
from org.python.core import CodeFlag
|
||||
co_varargs_flag = CodeFlag.CO_VARARGS.flag
|
||||
co_varkeywords_flag = CodeFlag.CO_VARKEYWORDS.flag
|
||||
else:
|
||||
co_varargs_flag = func_code.CO_VARARGS
|
||||
co_varkeywords_flag = func_code.CO_VARKEYWORDS
|
||||
|
||||
varargs = None
|
||||
if func_code.co_flags & func_code.CO_VARARGS:
|
||||
if func_code.co_flags & co_varargs_flag:
|
||||
varargs = func_code.co_varnames[nargs]
|
||||
nargs = nargs + 1
|
||||
varkw = None
|
||||
if func_code.co_flags & func_code.CO_VARKEYWORDS:
|
||||
if func_code.co_flags & co_varkeywords_flag:
|
||||
varkw = func_code.co_varnames[nargs]
|
||||
return args, varargs, varkw
|
||||
|
||||
|
||||
@@ -277,6 +277,16 @@ os.spawnvpe(mode, file, args, env)
|
||||
return getattr(os, original_name)(mode, path, patch_args(args), env)
|
||||
return new_spawnve
|
||||
|
||||
def create_fork_exec(original_name):
|
||||
"""
|
||||
_posixsubprocess.fork_exec(args, executable_list, close_fds, ... (13 more))
|
||||
"""
|
||||
def new_fork_exec(args, *other_args):
|
||||
import _posixsubprocess
|
||||
args = patch_args(args)
|
||||
return getattr(_posixsubprocess, original_name)(args, *other_args)
|
||||
return new_fork_exec
|
||||
|
||||
def create_CreateProcess(original_name):
|
||||
"""
|
||||
CreateProcess(*args, **kwargs)
|
||||
@@ -351,6 +361,11 @@ def patch_new_process_functions():
|
||||
|
||||
if sys.platform != 'win32':
|
||||
monkey_patch_os('fork', create_fork)
|
||||
try:
|
||||
import _posixsubprocess
|
||||
monkey_patch_module(_posixsubprocess, 'fork_exec', create_fork_exec)
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
#Windows
|
||||
try:
|
||||
@@ -380,6 +395,11 @@ def patch_new_process_functions_with_warning():
|
||||
|
||||
if sys.platform != 'win32':
|
||||
monkey_patch_os('fork', create_warn_multiproc)
|
||||
try:
|
||||
import _posixsubprocess
|
||||
monkey_patch_module(_posixsubprocess, 'fork_exec', create_warn_multiproc)
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
#Windows
|
||||
try:
|
||||
|
||||
@@ -66,7 +66,7 @@ def _patch_import_to_patch_pyqt_on_import(patch_qt_on_import):
|
||||
#we should not show frame added by patched_import call
|
||||
return type, value, traceback.tb_next
|
||||
return type, value, traceback
|
||||
|
||||
|
||||
def patched_import(name, *args, **kwargs):
|
||||
if patch_qt_on_import == name or name.startswith(dotted):
|
||||
builtins.__import__ = original_import
|
||||
@@ -80,7 +80,7 @@ def _patch_import_to_patch_pyqt_on_import(patch_qt_on_import):
|
||||
import __builtin__ as builtins
|
||||
builtins.__import__ = patched_import
|
||||
sys.exc_info = patched_exc_info
|
||||
|
||||
|
||||
|
||||
def _internal_patch_qt():
|
||||
try:
|
||||
@@ -97,7 +97,7 @@ def _internal_patch_qt():
|
||||
_original_thread_init = QtCore.QThread.__init__
|
||||
_original_runnable_init = QtCore.QRunnable.__init__
|
||||
_original_QThread = QtCore.QThread
|
||||
|
||||
|
||||
|
||||
class FuncWrapper:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user