[issue6400] incorrect commands import
Benjamin Peterson
report at bugs.python.org
Thu Jul 2 17:59:19 CEST 2009
Benjamin Peterson <benjamin at python.org> added the comment:
Thanks for the bug report! Fixed in r73771. Now when I run it on
mercurial/dispatch.py I get:
--- mercurial/dispatch.py (original)
+++ mercurial/dispatch.py (refactored)
@@ -5,11 +5,11 @@
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2, incorporated herein by reference.
-from i18n import _
+from .i18n import _
import os, sys, atexit, signal, pdb, socket, errno, shlex, time
-import util, commands, hg, fancyopts, extensions, hook, error
-import cmdutil, encoding
-import ui as _ui
+from . import util, commands, hg, fancyopts, extensions, hook, error
+from . import cmdutil, encoding
+from . import ui as _ui
def run():
"run the command in sys.argv"
@@ -486,7 +486,7 @@
p.disable()
if format == 'kcachegrind':
- import lsprofcalltree
+ from . import lsprofcalltree
calltree = lsprofcalltree.KCacheGrind(p)
calltree.output(ostream)
else:
RefactoringTool: Files that need to be modified:
RefactoringTool: mercurial/dispatch.py
Much better. :)
I'm glad to see someone is working on porting mercurial. You might want
to use the 2to3 development version, since it's always up to date wiht
bug fixes. [1] If you need any help, feel free to email the
python-porting list.
[1] http://svn.python.org/projects/sandbox/trunk/2to3
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6400>
_______________________________________
More information about the Python-bugs-list
mailing list