Small patch to keyword extension ('module' object has no attribute '_parse')
Marcin Kasperski
Marcin.Kasperski at softax.com.pl
Mon Nov 5 09:32:31 CST 2007
I just tried setting up keyword extension on some Debian testing box,
just to see things like:
$ hg status
*** failed to import extension hgext.keyword: 'module' object has no attribute '_parse'
*** failed to import extension hgext.keyword: 'module' object has no attribute '_parse'
Or if one prefers details:
python keyword.py
Traceback (most recent call last):
File "/var/lib/python-support/python2.4/hgext/keyword.py", line 93, in ?
_parse = dispatch._parse
File "/var/lib/python-support/python2.4/mercurial/demandimport.py", line 75, in __getattribute__
return getattr(self._module, attr)
AttributeError: 'module' object has no attribute '_parse'
I am not sure what exactly happened (previously installed keyword on
some ubuntu and debian stable and there everything went OK). But the
following tiny patch resolves the problem and makes keyword to work:
# HG changeset patch
# User Marcin Kasperski <Marcin.Kasperski at softax.pl>
# Date 1194276464 -3600
# Node ID f38ac7d5771ca4593a433f5475b60cc4c71534fb
# Parent 62eff490c844015812000397c3ccb0164ab07416
proba popr. problemu
diff -r 62eff490c844 -r f38ac7d5771c hgkw/keyword.py
--- a/hgkw/keyword.py Mon Oct 29 10:55:41 2007 +0100
+++ b/hgkw/keyword.py Mon Nov 05 16:27:44 2007 +0100
@@ -91,7 +91,7 @@ try:
# cmdutil.parse moves to dispatch._parse in 18a9fbb5cd78
from mercurial import dispatch
_parse = dispatch._parse
-except ImportError:
+except (ImportError, AttributeError):
try:
# commands.parse moves to cmdutil.parse in 0c61124ad877
_parse = cmdutil.parse
More information about the Mercurial
mailing list