2009-12-26 81 views
1

我寫一個程序:pylint的PyQt4的錯誤

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,

我只收到一條錯誤消息,爲什麼?

回答

1

看起來像astng的錯誤我會檢查。他們嘗試讀取不發佈它的函數的名稱(原生擴展函數)。我會向astngpyqt項目報告錯誤。第一個原因是他們應該更好地處理無名稱的情況。第二個是每個理智的擴展應該至少發佈函數名稱。

0

如果你使用了最新的astng,pylint的,等