[Python-checkins] r65855 - in python/trunk: Lib/lib2to3 Lib/lib2to3/refactor.py Tools/scripts/2to3

benjamin.peterson python-checkins at python.org
Tue Aug 19 18:41:35 CEST 2008


Author: benjamin.peterson
Date: Tue Aug 19 18:41:34 2008
New Revision: 65855

Log:
Merged revisions 65853-65854 via svnmerge from 
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r65853 | benjamin.peterson | 2008-08-19 11:09:09 -0500 (Tue, 19 Aug 2008) | 1 line
  
  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
........
  r65854 | benjamin.peterson | 2008-08-19 11:37:38 -0500 (Tue, 19 Aug 2008) | 1 line
  
  another quick fix to get lib2to3 to work
........


Modified:
   python/trunk/Lib/lib2to3/   (props changed)
   python/trunk/Lib/lib2to3/refactor.py
   python/trunk/Tools/scripts/2to3

Modified: python/trunk/Lib/lib2to3/refactor.py
==============================================================================
--- python/trunk/Lib/lib2to3/refactor.py	(original)
+++ python/trunk/Lib/lib2to3/refactor.py	Tue Aug 19 18:41:34 2008
@@ -172,9 +172,11 @@
           want a pre-order AST traversal, and post_order is the list that want
           post-order traversal.
         """
-        fixer_pkg = self.fixer_dir.replace(os.path.sep, ".")
-        if os.path.altsep:
-            fixer_pkg = fixer_pkg.replace(os.path.altsep, ".")
+        if os.path.isabs(self.fixer_dir):
+            fixer_pkg = os.path.relpath(self.fixer_dir, os.path.join(os.path.dirname(__file__), '..'))
+        else:
+            fixer_pkg = self.fixer_dir
+        fixer_pkg = fixer_pkg.replace(os.path.sep, ".")
         pre_order_fixers = []
         post_order_fixers = []
         fix_names = self.options.fix

Modified: python/trunk/Tools/scripts/2to3
==============================================================================
--- python/trunk/Tools/scripts/2to3	(original)
+++ python/trunk/Tools/scripts/2to3	Tue Aug 19 18:41:34 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))


More information about the Python-checkins mailing list