问题检验.py在Jython内部使用时

2024-07-07 06:17:20 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是Jython开发的应用程序。当我尝试使用检验.py其中,它显示错误消息。在

我的代码是这样的

import inspect,os,sys,pprint,imp
def handle_stackframe_without_leak(getframe):
    frame = inspect.currentframe()
    try:
        function = inspect.getframeinfo(getframe)
        print inspect.getargvalues(getframe)
    finally:
        del frame
#
def raja(a):
    handle_stackframe_without_leak(inspect.currentframe())
    print a
#
def callraja():
    handle_stackframe_without_leak(inspect.currentframe())
    raja("raja@ad.com")
#
callraja()
raja("raja@ad.com")
#

当我使用python.exe,没有问题。但是,在应用程序内部使用此选项会引发以下错误

^{pr2}$

任何帮助都将不胜感激。在

谢谢 拉贾桑卡尔


Tags: 应用程序def错误frameadwithouthandleprint
2条回答

你试过用Jython在命令行上运行你的程序吗?当我用jython2.2.1或jython2.5.0运行程序时,得到的输出与Python相同。在

这可能有助于http://grinder.sourceforge.net/faq.html#re-problems。在

为了快速检查,请尝试在findsource方法(C:\ProgramFiles\jython221ondiffjava\Lib)中添加import re\检验.py


def findsource(object):
    """Return the entire source file and starting line number for an object.
    (...snip...)"""
    import re
    file = getsourcefile(object) or getfile(object)

但不能保证什么。。。在

相关问题 更多 >