[Python-checkins] r65853 - in sandbox/trunk/2to3: 2to3 lib2to3/refactor.py

benjamin.peterson python-checkins at python.org
Tue Aug 19 18:09:10 CEST 2008


Author: benjamin.peterson
Date: Tue Aug 19 18:09:09 2008
New Revision: 65853

Log:
apply a patch for #3131. this solves the problem for the moment, but we should do some refactoring to get display logic out of RefactoringTool

Modified:
   sandbox/trunk/2to3/2to3
   sandbox/trunk/2to3/lib2to3/refactor.py

Modified: sandbox/trunk/2to3/2to3
==============================================================================
--- sandbox/trunk/2to3/2to3	(original)
+++ sandbox/trunk/2to3/2to3	Tue Aug 19 18:09:09 2008
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 from lib2to3 import refactor
 import sys
+import os
 
-sys.exit(refactor.main("lib2to3/fixes"))
+fixers = os.path.join(os.path.dirname(refactor.__file__), "fixes")
+sys.exit(refactor.main(fixers))

Modified: sandbox/trunk/2to3/lib2to3/refactor.py
==============================================================================
--- sandbox/trunk/2to3/lib2to3/refactor.py	(original)
+++ sandbox/trunk/2to3/lib2to3/refactor.py	Tue Aug 19 18:09:09 2008
@@ -172,7 +172,8 @@
           want a pre-order AST traversal, and post_order is the list that want
           post-order traversal.
         """
-        fixer_pkg = ".".join(self.fixer_dir.split(os.path.sep))
+        fixer_pkg = os.path.relpath(self.fixer_dir, os.path.join(os.path.dirname(__file__), '..'))
+        fixer_pkg = fixer_pkg.replace(os.path.sep, ".")
         pre_order_fixers = []
         post_order_fixers = []
         fix_names = self.options.fix


More information about the Python-checkins mailing list