keyword: pylint errors

Christian Ebert blacktrash at gmx.net
Mon Feb 8 19:09:24 CST 2010


Hi,

I'm aiming pylint at the keyword extension without knowing what I
am doing ;-) So some informed pointers/help would be great.

$ pylint -e keyword.py
Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <type 'exceptions.RuntimeError'> ignored
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.AttributeError'> ignored
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.AttributeError'> ignored
************* Module keyword
E1101:472:reposetup.kwrepo.file: Instance of 'kwrepo' has no 'sopener' member
E1002:474:reposetup.kwrepo.wread: Use super on an old style class
E1002:478:reposetup.kwrepo.commit: Use super on an old style class
E1002:487:reposetup.kwrepo.kwcommitctx: Use super on an old style class
E1101:490:reposetup.kwrepo.kwcommitctx: Instance of 'kwrepo' has no 'wlock' member
E1101:491:reposetup.kwrepo.kwcommitctx: Instance of 'kwrepo' has no 'lock' member
E1101:509:reposetup.kwrepo.kwcommitctx: Instance of 'kwrepo' has no 'hook' member


Let's put the RuntimeError aside, at least for the moment. Now,
with the following change:

diff --git a/hgext/keyword.py b/hgext/keyword.py
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -465,7 +465,7 @@
 
     kwtools['templater'] = kwt = kwtemplater(ui, repo)
 
-    class kwrepo(repo.__class__):
+    class kwrepo(localrepo.localrepository):
         def file(self, f):
             if f[0] == '/':
                 f = f[1:]
$ pylint -e keyword.py
Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <type 'exceptions.RuntimeError'> ignored
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.AttributeError'> ignored
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.AttributeError'> ignored


only the RuntimeErrors are left, which looks like an improvement
to me, escpecially as test-keyword does not complain.

Any thoughts?

TIA

c

P.S. Why does pylint deprecate the builtin map() function?
-- 
\black\trash movie    _C O W B O Y_  _C A N O E_  _C O M A_
                     Ein deutscher Western/A German Western

         --->> http://www.blacktrash.org/underdogma/ccc.php


More information about the Mercurial-devel mailing list