0

我最近将我的 PyDev 插件升级到版本 5.7.0.20170411357。似乎 IronPython 不再受支持。

我正在使用 Eclipse Oxygen

有人有解决方法吗?

启动调试器时,会显示以下消息:RuntimeError: Unable to continue(sys._current_frames 在此 Python 实现中不可用)。

是的,我正在添加 Vm 参数 -x:Frames。

该错误是从 pydevd_additional_thread_info_regular.py 抛出的。有一个适用于 Jython 的住宿。

if not hasattr(sys, '_current_frames'):

# Some versions of Jython don't have it (but we can provide a replacement)
if IS_JYTHON:
    from java.lang import NoSuchFieldException
    from org.python.core import ThreadStateMapping
    try:
        cachedThreadState = ThreadStateMapping.getDeclaredField('globalThreadStates') # Dev version
    except NoSuchFieldException:
        cachedThreadState = ThreadStateMapping.getDeclaredField('cachedThreadState') # Release Jython 2.7.0
    cachedThreadState.accessible = True
    thread_states = cachedThreadState.get(ThreadStateMapping)

    def _current_frames():
        as_array = thread_states.entrySet().toArray()
        ret = {}
        for thread_to_state in as_array:
            thread = thread_to_state.getKey()
            if thread is None:
                continue
            thread_state = thread_to_state.getValue()
            if thread_state is None:
                continue

            frame = thread_state.frame
            if frame is None:
                continue

            ret[thread.getId()] = frame
        return ret
else:
    raise RuntimeError('Unable to proceed (sys._current_frames not available in this Python implementation).')

否则:_current_frames = sys._current_frames

4

0 回答 0