pylint PyQt4错误

发布于 2024-08-16 06:11:21 字数 3272 浏览 7 评论 0原文

我写了一个程序:

from PyQt4.QtCore import *
from PyQt4.QtGui import *

def main():
    app = QApplication([])
    button = QPushButton("hello?")
    button.show()
    app.exec_()

if __name__=="__main__":
    main()

文件名是t.py, 当我运行时:

pylint t.py

在ubuntu9.10,pyqt4中, 我得到这个:

pylint t.py
No config file found, using default configuration
error while building astng for /home/halida/data/workspace/test/t.py
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/logilab/astng/manager.py", line 126, in astng_from_file
    astng = ASTNGBuilder(self).file_build(filepath, modname)
  File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 118, in file_build
    node = self.string_build(data, modname, path)
  File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 128, in string_build
    return self.ast_build(parse(data + '\n'), modname, path)
  File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 147, in ast_build
    self.rebuilder.walk(node)
  File "/usr/lib/pymodules/python2.6/logilab/astng/rebuilder.py", line 89, in walk
    self._walk(node)
  File "/usr/lib/pymodules/python2.6/logilab/astng/rebuilder.py", line 109, in _walk
    self._walk(child, node)
  File "/usr/lib/pymodules/python2.6/logilab/astng/rebuilder.py", line 103, in _walk
    handle_leave = node.accept(self)
  File "/usr/lib/pymodules/python2.6/logilab/astng/nodes.py", line 159, in accept
    return func(self)
  File "/usr/lib/pymodules/python2.6/logilab/astng/rebuilder.py", line 188, in visit_from
    imported = node.root().import_module(node.modname)
  File "/usr/lib/pymodules/python2.6/logilab/astng/scoped_nodes.py", line 282, in import_module
    return MANAGER.astng_from_module_name(self.relative_name(modname, level))
  File "/usr/lib/pymodules/python2.6/logilab/astng/manager.py", line 172, in astng_from_module_name
    return self.astng_from_module(module, modname)
  File "/usr/lib/pymodules/python2.6/logilab/astng/manager.py", line 207, in astng_from_module
    astng = ASTNGBuilder(self).module_build(module, modname)
  File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 80, in module_build
    node = self.inspect_build(module, modname=modname, path=path)
  File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 95, in inspect_build
    self.object_build(node, module)
  File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 195, in object_build
    self.object_build(class_node, member)
  File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 198, in object_build
    object_build_methoddescriptor(node, member)
  File "/usr/lib/pymodules/python2.6/logilab/astng/raw_building.py", line 150, in object_build_methoddescriptor
    func = build_function(member.__name__, doc=member.__doc__)
AttributeError: 'PyQt4.QtCore.pyqtSignal' object has no attribute '__name__'
************* Module t
F:  1: <class 'logilab.astng._exceptions.ASTNGBuildingException'>: Unable to load module t ('PyQt4.QtCore.pyqtSignal' object has no attribute '__name__')

Compilation exited abnormally with code 1 at Sat Dec 26 10:43:54

在 Windows XP 中,使用 pythonxy,

我只收到一条错误消息,为什么?

I write a program :

from PyQt4.QtCore import *
from PyQt4.QtGui import *

def main():
    app = QApplication([])
    button = QPushButton("hello?")
    button.show()
    app.exec_()

if __name__=="__main__":
    main()

the file name is t.py,
when I run:

pylint t.py

in ubuntu9.10, pyqt4,
I got this:

pylint t.py
No config file found, using default configuration
error while building astng for /home/halida/data/workspace/test/t.py
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/logilab/astng/manager.py", line 126, in astng_from_file
    astng = ASTNGBuilder(self).file_build(filepath, modname)
  File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 118, in file_build
    node = self.string_build(data, modname, path)
  File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 128, in string_build
    return self.ast_build(parse(data + '\n'), modname, path)
  File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 147, in ast_build
    self.rebuilder.walk(node)
  File "/usr/lib/pymodules/python2.6/logilab/astng/rebuilder.py", line 89, in walk
    self._walk(node)
  File "/usr/lib/pymodules/python2.6/logilab/astng/rebuilder.py", line 109, in _walk
    self._walk(child, node)
  File "/usr/lib/pymodules/python2.6/logilab/astng/rebuilder.py", line 103, in _walk
    handle_leave = node.accept(self)
  File "/usr/lib/pymodules/python2.6/logilab/astng/nodes.py", line 159, in accept
    return func(self)
  File "/usr/lib/pymodules/python2.6/logilab/astng/rebuilder.py", line 188, in visit_from
    imported = node.root().import_module(node.modname)
  File "/usr/lib/pymodules/python2.6/logilab/astng/scoped_nodes.py", line 282, in import_module
    return MANAGER.astng_from_module_name(self.relative_name(modname, level))
  File "/usr/lib/pymodules/python2.6/logilab/astng/manager.py", line 172, in astng_from_module_name
    return self.astng_from_module(module, modname)
  File "/usr/lib/pymodules/python2.6/logilab/astng/manager.py", line 207, in astng_from_module
    astng = ASTNGBuilder(self).module_build(module, modname)
  File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 80, in module_build
    node = self.inspect_build(module, modname=modname, path=path)
  File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 95, in inspect_build
    self.object_build(node, module)
  File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 195, in object_build
    self.object_build(class_node, member)
  File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 198, in object_build
    object_build_methoddescriptor(node, member)
  File "/usr/lib/pymodules/python2.6/logilab/astng/raw_building.py", line 150, in object_build_methoddescriptor
    func = build_function(member.__name__, doc=member.__doc__)
AttributeError: 'PyQt4.QtCore.pyqtSignal' object has no attribute '__name__'
************* Module t
F:  1: <class 'logilab.astng._exceptions.ASTNGBuildingException'>: Unable to load module t ('PyQt4.QtCore.pyqtSignal' object has no attribute '__name__')

Compilation exited abnormally with code 1 at Sat Dec 26 10:43:54

in windows XP, with pythonxy,

I only got a error message, why?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

魄砕の薆 2024-08-23 06:11:21

看起来像是 astng 中的错误。他们尝试读取未发布的函数的名称(本机扩展 func)。我会向 astngpyqt 项目报告错误。第一个是他们应该更好地处理无名情况。第二个是每个理智的扩展都应该至少发布函数名称。

Looks like a bug in astng. They try to read the name of a function which does not publish it (native extension func). I'd report a bug to both astng and pyqt projects. The first one would be that they should handle a no-name situation better. The second one would be that every sane extension should publish at least the function names.

旧时模样 2024-08-23 06:11:21

我会检查你是否使用最新的 astng、pylint 等。

I would check if you're using the very latest astng, pylint, etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文